The following table lists all the data types available for Tags in Ignition.
|Data Type||String Value||Integer Value|
|Document (JSON Document)||Document||29|
Array and Dataset Data Types
The Array and Dataset data types available on Tags 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.
Most OPC device drivers do not support array and dataset data types. These types work best when used on query tags or memory tags. When working with arrays via our OPC UA device drivers, it is recommended to create Ignition tags for each array element instead of using an array data type tag.
For OPC servers and drivers that support array type Tags, each element in the array can easily be represented with the array data types in Ignition. 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.
Array Tag Write-Back
OPC Array Tags support writing back to the device. How this is done can vary, depending on the type of OPC Server in use. Some OPC Servers support writes to individual array elements, where a write would occur just like any other Tag write. However, some OPC Servers do not support individual element writes, which means the whole array will need to be written back to the array Tag, even if only a single element is changing.
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 image below). 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 more efficient than using multiple query Tags (and thus multiple queries) to retrieve the same data.
While dataset tags are convenient, note that the Tag History system and Alarm system do not support tags with dataset types.
Valid data types that can be stored in dataset tags include the following:
- Byte Arrays are now supported as of 8.1.20
Dataset Tag Example
The following example will create a dataset memory Tag and display the contents in a Table component.
The Tag will now contain rows, columns, and values based on the configurations you made earlier in this example. Now you have a Tag with a dataset value that can be bound to by components in Vision and Perspective.
The document type allows a tag to have a JSON document as a value. Note that the Tag History system does not support tags with a document type.
Most OPC device drivers do not support the document data type. This type works best when used on query tags or memory tags.
The document tag type now supports writing to OPC tags containing DocumentArray values.
Setting a Tag to this type will cause the value field to display an icon.
Clicking the icon will transition the Tag Editor into a JSON Editor, allowing you to manually write JSON directly to the value.
Click the + icon to add new members to the object. When finished, press Commit.
When saved, the value of the tag will render as a JSON document in the tag browser.