Tags
Tags are used to communicate information between the PLC and Sym3. Tags are associated with one type and can return Value and Quality for the Tag.
Tag names must be unique, cannot contain any space characters. The math symbols (-/*+) must be avoided so that these are not evaluated as part of an expression.
Create a new Tag (+)
New Tags can be created in Sym3 using the Tags Manager that can be accessed from Ribbon > Home > Tags
Clicking on + creates a new Tag with a default name (Tag1) in the Tag Manager Panel. Double-click on this name to change it. This name has to be unique in this list.
Delete a Tag (-)
Open the Tag Manager, select the entry to be deleted and click on -
A confirmation screen will appear, ensure this is the correct Tag and click Yes to delete it.
Delete all Tags (-*)
Pressing this button prompts the user that they will be deleting all Tags. A Yes response removes all Tags from the list. This is most often used to clear all Tags before a re-import to update changes.
Select all Tags
Open the Tag Manager, select the few tags and you can change the property of Tags all the selected Tags in one go.
Import Tags
Opens a file open window that should be browsed to a suitable CSV Tag import file. If any inconsistencies or errors are encountered then these appear in a window and no Tags are imported. Any CSV Tag import file with more columns than expected will be trimmed automatically before being imported.
Export Tags
Opens a file open window that should be browsed to a suitable location to save the CSV Tag export file. You can export invalid or faulty Tags.
Browse
Opens an OPC Tag Browser window on the Data Source to allow adding these to the Tag database. The list shows Tag Name, Type and Detail.
Show Live Values
This button turns on the polling of all the tags reading the value and quality, displaying it in the rightmost columns.
This option is used to verify the connection to the Data Source is working.
Search
The Search field offers a filter such that only Tags matching the filter are displayed in the list. To see all Tags, ensure this field is empty.
In this example the ESA tag is ‘GOOD’ and has a current value of ‘False’, Tag1 has a value of zero.
Locate Equipment
In the Tag Manager, right click on a tag, a contextual menu pops-up with one action “Locate Equipment”. Using this action on a valid equipment, will locate equipment in 3D view and display properties. Same is the case for Device I/O.
Editing a Tag
You can edit a tag by:
- Click on the Property Editor option in the Ribbon bar to open the Property Editor Panel.
- Either select an entry from the Alarms Panel or, from the Project Explorer panel, select Tags or multi select Tag
The property settings for the selected Tag will appear in the Property Editor Window and allow changes to its properties;
- Name: Unique name of the Tag.
- General > Data source: The data source to read the values from or to write the values to.
- General > Address: PLC address for the Tag. The exact format changes depending on the data source used; see the specific data source documentation for details.
- General > Data Type: Select from one of the following supported data types (not all data sources support all data types):
- Default: Defaults to Short
- Boolean: Boolean (0 or 1)
- Char: Byte (eg. ‘A’)
- Byte: Byte (0 - 255)
- Short: Int 16 (-32767 - 32767)
- Word: Unsigned Int 16 (0 - 65535)
- Long: Int 32 (-2,147,483,647 - 2,147,483,647)
- DWord: Unsigned Int 32 (0 - 4,294,967,295)
- Float: Float
- Double: Double
- String: String
- Date: (0 - 65535)
- ByteArray (See ByteArray for details.)
- General > Update Rate: Update interval in milliseconds. For example, if this is set to 500, then every 0.5 seconds this Tag (and all other Tags set to 500) will be updated.
- General > Simulate Tag: Defaults to disabled but when enabled Sym3 will simulate the Tag. That is, no PLC will be used.
- General > Is Bit Word Tag: Sets this Tag as a bit word tag. It will be expandable and contain 16 individual bit tags that comprise its value. (bit word tags can not be simulated.)
- Diagnostics > Current Value: The current value for the Tag when ‘Show Live Values’ is enabled.
- Diagnostics > Current Quality: The current quality for the Tag when Show Live Values has been used. A zero indicates a Good (reliable) quality while any other value indicates potential uncertainty in the value it returns. See " OPC Functions" for quality values.
- Diagnostics > Override Tag: Force the tag value to what is entered in the Value.
- Equipment > Name: The name of the associated equipment in the Project Explorer.
- Equipment > Type: The type of the associated equipment e.g. Conveyor, PE Sensor
- Equipment > Property: The property being changed on the associated equipment. For example, StartStopRequest, Blocked.
- Equipment > Script Handler: Name of the simulation script function to execute for complex data conversions.
- Equipment > I/O Type: Integrator only. Either Input (to Sym3) or Output (from Sym3). This changes how the equipment property is interacted with. An input tag will update the equipment property when the tag changes, whereas an output tag will be updated when the equipment property changes. Input and output tags are treated the same by data sources; if an input tag is written to by SetTagValue, for example, the value will change on the associated data source.
- Equipment > Inverted Logic: Invert Boolean type only (True to False, False to True).
- Equipment > Comment: User comment for Tag.
Import / Export file structure
The Tags file for both Export and Import will have a CSV structure similar to;
TagName,DataSource,Address,DataType,RefreshRate,Simulate Tag,EquipmentName,EquipmentType,EquipmentProperty,ScriptHandler,IOType,InvertedLogic,Comment,PrimaryBitWordTagId
ESA,Kepware.KEPServerEX.V5,Channel1.Device1.ESA1,Boolean,500,0,,,,,Output,0,
Tag1,Kepware.KEPServerEX.V5,Channel1.Device1.Tag1,Word,500,0,,,,,Output,0,Tag1
Tag1.0,Kepware.KEPServerEX.V5,Channel1.Device1.Tag1.0,Word,500,0,,,,,Output,0,Tag1
Tag1.1,Kepware.KEPServerEX.V5,Channel1.Device1.Tag1.1,Word,500,0,,,,,Output,0,Tag1
Live value and Manual override
Tags allows information for multiple equipment to be exchanged as a single message to a PLC. The Tags translate the equipment property to bit(s) in the message. The PLC program interprets the message and processes the information as required.
To aid the PLC Engineer in testing the PLC and Sym3Integrator projects, the current value and an override button has been added.
For convenience and consistency with the Tags, two new columns have been added to the Tag manager.
- Override value: The override value supplied by the user
- Override: Boolean, default false. Flags if this value is to be overridden.
Bit word tags
A tag that contains a 16-bit WORD value, and it has 16 linked child tags that represent its individual bits.
If the parent bit word tag is updated, each of its children will be updated to reflect its value. If a child bit word tag is updated, its bit value will propagate up to its parent, and its parent value will be changed.
These tags are required to be set as either Input or Output.
- Output Sym3 updates output bitword tags and ignores any changes received from the datasource.
- Input Input bitword tags are read-only for Sym3 and only change when the datasource updates them.
Simulated bit word tags are not supported.
ByteArray
ByteArray is a tag type that allows access to data types as an array of bytes. This allows for the modification of user defined types and entire arrays, rather than binding to individual members and elements.
There are a few things to be aware of:
- ByteArrays are only supported on the Echo and CIP (Allen-Bradley ControlLogix) data sources.
- ByteArray tags cannot have their values overridden.
- No components produce or consume byte arrays natively. Simulation script is required to make use of ByteArrays.
- Multi-byte values’ endianess is hardware specific. With the Echo and CIP they’re little-endian (For example, to write 3 to a 32 bit integer you would set [3, 0, 0, 0]). However if additional data sources gain ByteArray support, multi-byte values may be big-endian.
- Using a ByteArray tag in a CIP data source will cause a delay on start up as Sym3 retrieves project type information required. The length of the delay depends on the size of the project on the PLC, the speed of connection, and other such factors.
From simulation script, you can get and set ByteArray tags you would any other tag:
let arr = GetTagValue("ByteArrayTag");
// How many bytes are in the array?
LogDebug("ByteArrayTag Length = " + arr.length);
// Print the values of the array.
for (let i = 0; i < arr.length; ++i)
{
LogDebug(`ByteArrayTag[${i}] = ${arr[i]}`);
}
To write to a byte array, use SetTagValue
with an array containing only numbers between 0 and 255.
let arr = [1, 2, 0, 0, 5];
SetTagValue("ByteArrayTag", arr);
If the array given to SetTagValue while setting a ByteArray typed tag contains a value that isn’t a number, or a number that falls outside of 0 and 255 an exception will be thrown and the tag will not be changed.