Timestamp and Quality Support
- Last UpdatedJul 07, 2025
- 3 minute read
The Plant SCADA OPC driver can use additional variable tags for quality and timestamp values. Quality or timestamp tags are duplicates of a variable tag, with an appended "!Q" or "!T" or "!M" in the address field to define their purpose. Quality tags need to be configured as either INT or DIGITAL data types, whereas Timestamp tags need to be configured as LONG data types.
If you just need to know if an OPC item is good or bad quality (i.e. not uncertain), you should consider using DIGITAL data types for quality tags in combination with [OPC]DigitalQualityUncertainIsBad, rather than using Cicode to compare the value of an INT quality tag against 0xC0.
Note: The quickest way to create a quality or timestamp tag in Plant SCADA is to locate the relevant variable tag using the Variable Tags dialog box, edit it as required to create a quality or timestamp tag, and save it. This creates a copy of the original variable tag with the required changes saved.
To create a quality tag:
-
Open the Plant SCADA Studio.
-
In the Topology activity, go to Equipment tab.
-
In the editor, create a new variable tag, or locate the tag that you want to associate the quality tag with.
-
In the Name field, enter an appropriate and unique name for the quality tag, such as "<Tagname>_Quality".
-
In the Type field, choose INT or DIGITAL from the menu.
-
In the I/O Device field, select the appropriate I/O device for the tag (if not already displayed).
-
In the Display Name box, enter the name of the tag you want to associate with the quality value (if not already displayed), and append "!Q" directly to the end of the address (without the quotes and without any spaces).
-
Click Save.
Note: If the exclamation mark character (!) is already defined in the Display Name field (for example, you have already used it to declare an array size "!A[n]"), you either need to include another exclamation mark (e.g. append "!Q" to the display name) after the closing square bracket of the array size declaration, or you can specify quality for arrayTag!A[5] with just arrayTag!Q".
To create a timestamp tag:
-
Open the Plant SCADA Studio.
-
In the Topology activity, go to Equipment tab.
-
In the editor, create a new variable tag, or locate the tag that you want to associate the quality tag with.
-
In the Name field, enter an appropriate and unique name for the timestamp tag, such as <Tagname>_sTimestamp (for seconds) or <Tagname>_msTimestamp (for milliseconds).
-
In the Type field, choose Long from the menu (if not already selected).
-
In the I/O Device field, select the appropriate I/O device for the tag (if not already displayed).
-
In the Display Name box, enter the name of the tag you want to associate with a timestamp value (if not already displayed), and append "!T" or "!M" (as appropriate).
Note: If there is already an exclamation mark with other declarations included in the display name, you don’t need to include them for timestamping. For example, a timestamp tag monitoring TagName!A[64] can be addressed as TagName!T.
-
Click Add.
Note: Timestamps store the number of seconds since 01/01/1970 when using the "!T" element, or the number of milliseconds since midnight using the "!M" element. If you want to store a complete time in millisecond accuracy, you need to create two separate timestamp tags, one for seconds and one for milliseconds, each addressed appropriately.
Examples
In the following examples, an OPC device tag defined on a BACnet OPC server is associated with the base Plant SCADA variable tag named Present_Value:
|
Variable Tag Name |
Present_Value |
|
Address |
device(7196).analog-output(1).present-value |
|
Plant SCADA Data Type |
Data type required by project (for a list of data types, see Data Types). |
Example 1
Use the following settings to associate a Plant SCADA variable tag with the quality stamp of the OPC register value:
|
Variable Tag Name |
Present_Value_Quality |
|
Address |
device(7196).analog-output(1).present-value!Q |
|
OPC Type |
VT_QUALITY |
|
Plant SCADA Data Type |
INT or DIGITAL |
Example 2
The following tag definition will read the Timestamp value measured in seconds from 1/Jan/1970:
|
Variable Tag Name |
Present_Value_Timestamp |
|
Address |
device(7196).analog-output(1).present-value!T |
|
OPC Type |
VT_TIMESTAMP |
|
Plant SCADA Data Type |
LONG |
Example 3
The tag definition below will read the Millisecond Timestamp value measured in UTC FileTime from beginning (midnight) of the current day:
|
Variable Tag Name |
Present_Value_Millisecond |
|
Address |
device(7196).analog-output(1).present-value!M |
|
OPC Type |
VT_MILLISECOND |
|
Plant SCADA Data Type |
LONG |
The base Plant SCADA tag needs to be defined in Plant SCADA before the timestamp and quality values of the associated OPC Server tag value can be read.