Array and Dataset Tags

Array and Dataset data types are now available on tags. Both data types allow for multiple data points to be stored in a single tag. Configuring a tag as an array or dataset is as easy as changing the data type in the Tag Editor.

images/download/attachments/6034140/new_tag_datatype_array_tags.png

Array Tags

Many OPC servers and drivers already support array type tags, and now each element in the array can easily be represented with the array data types in Ignition. Additionally, array data types can be used with devices that do not support array types, and will instead expose each bit in the value.

Note: Individual members of Array Tags are read only, and cannot be used with bi-directional bindings. You can set the value of the whole array in scripting (ie: writing 5 to an Integer Array will set both the 0 and 2 positions to 1 and everything else to 0) or additional (non-array type) tags can be created to write to those addresses.

Array Alarm Example

Because the core data type of each element in the array is the same, it is possible to apply Tag History, Alarming, or Scaling configurations onto the array, and these configurations will be inherited by each element.

1) The WriteableInterger1 and WriteableInteger1_Copy tags below are using the same OPC Item Path, and both are currently configured as Integer tags.

images/download/attachments/6034140/array_example_intro.PNG

2) Edit the WriteableInteger1_Copy tag, and change it's data type to an Integer Array, and click OK

images/download/attachments/6034140/array_example_datatype.PNG

3) Once the tag finishes re-subscribing, the value for WriteableInteger1_Copy will now show "Array[32]" instead of the previous value. Expanding the tag reveals a new Value section, and expanding this section will show the value of each bit.

images/download/attachments/6034140/array_example_expand_tag.PNG

4) Next, edit the WriteableInteger1_Copy tag again, and head to the Alarming section. Create a new alarm with Mode set to Equal, but change the Setpoint to 1, and then click OK. This way an alarm will be active for each element that is set to 1.

images/download/attachments/6034140/array_example_alarming.PNG

5) Create a new Alarm Status Table report, and you should see an alarm for each true element.

images/download/attachments/6034140/array_example_alarm_table.PNG

Dataset Tags

images/download/attachments/6034140/new_tag_data_types_intro.PNG

Dataset Tags allow multiple rows and columns worth of data to be stored in a tag. Each column is exposed as a separate folder in the tag (i.e., the "name" folder in the above image). Dataset Tags can be driven by a query, so it's possible to query for multiple columns on a row in a single tag. This is much more efficient than using multiple query tags (and thus multiple queries) to retrieve the same data.

Memory Tags that use the Dataset type support bi-directional bindings in tables.

Dataset Tag Write Example

The following example will write the contents of a Table component to a dataset tag.

1) Create a new Memory tag. Name it Dataset, and change the data type to Dataset. The Dataset will be empty by default.

images/download/attachments/6034140/dataset_example.PNG

2) On a new window, add a button component and table component.

images/download/attachments/6034140/dataset_example_components.PNG

3) Generate some test data on the Table by toggling the TestData property.

images/download/attachments/6034140/dataset_example_testdata.PNG

4) Next, the button will need a script to handle writing to the tag. Right click on the button and select Scripting. Choose the actionPerformed Event Handler, and click on the Script Editor tab. Use the following code:

Code Snippet
#retrieve the data on the table and store it a variable.
data = event.source.parent.getComponent('Table').data
 
#write to the tag
system.tag.write("Dataset", data)

images/download/attachments/6034140/dataset_example_code.PNG

5) Make sure the Designer is set to Read/Write mode: Project menu > Comm Read/Write

images/download/attachments/6034140/dataset_example_read_write.png

6) Put the Designer into preview mode, and click on the button. The data in the table has been passed to the tag. Expanding the tag in the Tag Browser will show the new values on the tag.

images/download/attachments/6034140/dataset_example_finish.PNG

Next ...