This page details the different data types that can be applied to Standard Tags.

The data type of a Tag is determined by the Data Type property, which is accessible from the Tag Editor. The Tags system will attempt to coerce any raw incoming value (for example, from OPC or a SQL query) into the desired type.

On this page ...

IULocgo


Array and Dataset Tags

  

The following table lists all the data types available for Tags in Ignition.

Data TypeString ValueInteger Value
Byte
Int1
0
Short
Int2
1
Integer
Int4
2
Long
Int8
3
Float
Float4
4
Double
Float8
5
Boolean
Boolean
6
String
String
7

DateTime

Note: 

The Siemens driver does not support Ignition tag's DateTime type. In these cases it is recommended to extract each byte in in the Siemens DATE_AND_TIME value item, storing each into a separate Ignition tag.  Then use an expression tag to combine each byte into a human readable datetime. 

Example
// The following assumes each byte of the DATE_AND_TIME value is under a tag named like "BASIC_DATA_AND_TIME", and that each tag is a String type. 

"20" + //First part of the year, assuming in 21st century
toHex({[.]BASIC_DATE_AND_TIME[0]}) + “-” + 					//Second part of the year, reading from an Ignition tag. 
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[1]}), “00”) + “-” + //Month
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[2]}), “00”) + “-” + //Day
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[3]}), “00”) + “:” + //Hours
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[4]}), “00”) + “:” + //Minutes
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[5]}), “00”) + “:” + //Seconds
numberFormat(fromBinary(left(numberFormat(toBinary({[.]BASIC_DATE_AND_TIME[6]} + {[.]BASIC_DATE_AND_TIME[7]}), “0000000000000000”), 12)), “000”) + " " + //Milliseconds, it includes the first 4 bits of byte 7
case( //Day of the week, last 4 bits of byte 7
right(numberFormat(toBinary({[.]BASIC_DATE_AND_TIME[7]}), “00000000”), 4),
“0000”, “Sunday”,
“0001”, “Monday”,
“0010”, “Tueday”,
“0011”, “Wednesday”,
“0100”, “Thursday”,
“0101”, “Friday”,
“0111”, “Saturday”,
“Error - No Day Found”)

DateTime
8
Text


This feature was changed in Ignition version 8.1.8:
The Text data type on tags was deprecated

Text
10
Byte Array
Int1Array
17
Short Array
Int2Array
18
Integer Array
Int4Array
11
Long Array
Int8Array
12
Float Array
Float4Array
19
Double Array
Float8Array
13
Boolean Array
BooleanArray
14
String Array
StringArray
15
DateTime ArrayDateTimeArray16
Binary DataByteArray20
Dataset
DataSet
9
Document (JSON Document)Document29


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.

Note: 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. 

Array Tags

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

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:

  • Float
  • Short
  • Long
  • Date
  • Integer
  • Boolean
  • String
  • Color
  • Double
  • Timestamp

The following feature is new in Ignition version 8.1.20
Click here to check out the other new features

  • 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.

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



  2. Click the Edit icon next to Value. The Value screen is displayed. For this example, we created a simple dataset with four columns and five rows.
  3. Click the Add Column icon. Name the first column City and set type to be String.
  4. Click Add Column.



  5. Repeat adding columns as follows:

    Column Name: Population  Type: Integer
    Column Name: TimeZone Type: String
    Column Name: GMTOffset  Type: Integer

  6. Click the Add Row icon. Add the row information as follows:

    New York8368710EST-5
    Los Angeles3833995PST-8
    Chicago2853114CST-6
    Houston2242193CST-6
    Phoenix1567924MST-7
  7. Click the Commit button.

  8. Click OK to save the Tag.



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. 


Document Type

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. 

Note: Most OPC device drivers do not support the document data type. This type works best when used on query tags or memory tags. 
The following feature is new in Ignition version 8.1.27
Click here to check out the other new features
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. 




  • No labels