Search This Blog

Loading...

_____________________________________________________________

Monday, September 5, 2011

Program tracepoints


Tracepoints are programmed with the Tracepoint output instruction (TPT). When the inputs on a rung containing a TPT instruction are true, the TPT instruction writes a trace entry to a trace display or log file. (To configure how traces are displayed or logged, see Configure trace displays.)
Programming the TPT instruction
The Tracepoint (TPT) instruction has two kinds of parameters:
This parameter:
Contains:
Requires:
Format
A string that sets the formatting for the trace reports (both on-screen and logged to disk).
Trace This:
The tag you want to trace.
An INT, BOOL, SINT, DINT, or REAL tag.
You cannot trace tag structures (for example, entire timers or counters). However, you can trace individual structure members.
You can trace a large number of tags with the TPT instruction, but the formatting string can contain only 82 characters. Because two characters are required in the formatting string for each tag you want to trace, the maximum number of tags you could trace with a single TPT instruction is 41. However, you will probably want to include spaces and other formatting to separate tag data in your traces, so the resulting number of tags that can be traced by one TPT instruction is significantly lower than 41.
Example:
The following rung triggers a trace of three analog values when any one of them exceeds a given value (30.01).

We want to display the tracepoint information in a particular format. That format is contained in the Format string (myformat). In this case, the format string contains the following text:
Analog inputs trace:Analog inputs = %f, %f, and %f
When the tracepoint triggers, the characters before the colon ("Analog inputs trace") appear in the title bar of the trace window. The other characters make up the traces. In this example, the "%f" characters represent the tags to be traced ("analogvalue1," "analogvalue2," and "analogvalue3"). Click here for more information about formatting strings.
The resulting traces appear as shown in the following illustration.

When this trace is logged to disk, the characters before the colon appear in the traces. This indicates which tracepoint caused which trace entry. The following is an example of a trace entry. "Analog inputs trace:" is the heading text from the tracepoint's format string.
Analog inputs trace:Analog inputs = 31.00201, 30.282000, and 30.110001

Thursday, August 11, 2011

Configuring a tag in RSView32


Once you have created an OPC node for the emulator, you can add tags from your logic project to your RSView32 tag database. To do this:
  1. Open your RSView32 project.
  2. In your project’s System folder, open the Tag Database editor.
  3. In the Data Source section of the Tag Database editor, click Device.
  4. Click the button next to the Node Name field. This displays the Node Browser. Select the OPC node you created for the emulator and click OK.
  5. In the Tag section of the Tag Database editor, select the type of tag you want to create from the Type list.
  6. In the Data Source section of the Tag Database editor, click the button next to the Address field. This displays the OPC Address Browser.
  7. In the OPC Address Browser, select the address you want to use with the tag and click OK.

  1. Finish creating the tag by filling in the fields in the Tag Database editor:
For this field or control:
Set or enter:
Name
The name of the tag you want to create.
Security
If you have set up security for your RSView32 project, set the security class associated with the tag.
Description
Type a description of the tag (optional).
Minimum
The minimum value for the tag (as used in RSView32).
Maximum
The maximum value for the tag (as used in RSView32).
Scale
A scaling value for the tag.
Offset
A value to add to the tag.
Units
The units for the tag.
Data Type
Select the data type for the tag.
  1. Click Accept. The tag is stored in the tag database. You can now use the tag in your RSView32 project.