Open Platform Communications (OPC) timestamps
- Last UpdatedApr 24, 2025
- 1 minute read
The timestamps of all Open Platform Communications (OPC) data default to the time(s) when the PubSub message containing the data arrives. In the case of RealTime data, this may not be the timestamp of interest.
For example, if you attach to primary.realtime.db.analog.fred.curval, you may be more interested in the timestamp of the last time the analog curval internal field was changed. Telemetered data records in the RealTime database (RTDB) contain a timestamp field called lastKrunchTime indicating the time that the data was last processed. This allows the OPC client to read the lastKrunchTime value separately; however, it is not guaranteed to be synchronized with the current value (for example, if the current value is quickly updated more than once, you could associate the lastKrunchTime with the wrong current value).
For the current value fields (for example, curval) and data quality fields (for example, flag fields: alminh, alarm, error, fg (color) flash, manl, msgtxt, offscan, severity, tag) if you wish the OPC Server to return the time that the data was last processed rather than the time that PubSub received the data update, then add the following line to the %DNADataRoot%\RealTime\config\Settings\OPCDAServerConfig.json file:
"MAPTIMESTAMP": true
For example:
{
"RealTime":{
"OPCDAServer":{
"OASySDNA.OPCDAServer.1":{
"HPDB": false,
"LASTKRUNCHTIMEFROMPACKED": false,
"MAPDATAQUALITY": false,
"MAPTIMESTAMP": true,
"NOSYSTEMNAME": false,
"ACCESSPERMISSION": "READONLY",
"SECURITYOVERRIDE": false,
"VERBOSE": false,
"SUBSCRIPTIONS": []
}
}
}
}