Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Communication Drivers

MQTT Item Syntax for VTQ Timestamp

  • Last UpdatedAug 19, 2024
  • 2 minute read

Each payload in MQTT has an associated time value, which shows the time of occurrence of an event. Two time types are supported:

  • Unix timestamp

    • Example: 1507103430 = Wednesday October 4 2017 07:50:30 UTC)

  • ISO 8601 timestamp string in UTC format

    • Example 1: 2017-10-04T07:50:30Z = Wednesday October 4 2017 07:50:30 UTC)

    • Example 2 (when time is in ms): 2017-10-04T07:50:30.134Z = Wednesday October 4 2017 07:50:30.134 UTC).

    The ISO 8601 timestamp string ends with Z.

Using &T& String

For an accurate timestamp value of a data field, the MQTT data source concatenates the data field and the timestamp field using the &T& string. If a value item is X and the time item is Y, the item X&T&Y allows the value X to be timestamped with the value of Y. The resulting item is read-only.

Prerequisites to use &T& String

The prerequisites for using the &T& string to timestamp the date field are:

  • A time field must be available in the data record

  • The time field must be in Unix or ISO time type.

Examples

Example 1:

Data field: obj.temp_c

Timestamp field: obj.time

The syntax for VTQ time stamp using the &T& token:

obj.temp_c&T&obj.time

If the timestamp field is in the same object as the data field, the VTQ timestamp is obtained using the syntax:

obj.temp_c&T&.time

Example 2:

Consider two device items in the MQTTGroup node: Tank01_ISO and Tank01_Unix

For the device item Tank01_ISO:

  • Full syntax of the Item Reference is Tank01.Deg&T&Tank01.TimeISO

  • Short syntax of the Item Reference is Tank01.Deg&T&.TimeISO

For the device item Tank01_Unix:

  • Full syntax of the Item Reference is Tank01.Deg&T&Tank01.TimeUnix

  • Short syntax of the Item Reference is Tank01.Deg&T&.TimeUnix

At the command: Mosquitto_pub.exe -h mqtt.iot.wonderware.com -r -t Tank01 -m "{\"Deg\":13.7, \"lat\":33.65, \"lon\":-117.75, \"TimeISO\":\"2017-09-07T10:05:03.000Z\", \"TimeUnix\":1505392740}", the values are displayed in the Client.

Embedded Image (65% Scaling) (LIVE)

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in