Home FAQPricesIOServer Users

Writing User specified timestamp to DNP Slave

Normally the timestamp as supplied from any OPC Server is passed unchanged to the device.

If the OPC Client writes a word array of exactly 25 words long or string in the following format.


V Analog Value
: Separator
MM Month
DD Day
mm Minute
SS Second
sss ms
q quality (0 is good quality (c0) and non-zero is uncertain quality(40)), ":q" may be omitted if not required

then the specified analog value and timestamp will be passed to the device.

For example, if the analog value is 1 and it happened at
14:30:25.254 on 16 April, 2002, then the message will be

Values that are not specified are set to zero.

To use this feature the source OPC Server must be capable of returning the analog value and timestamp in a single word array of 25 words or as a string.

Each OPC Server have their own method of accessing arrays e.g RSLinx OPC Server\[GM3_LCU12]Feeder_SOE.GM3_146.SF6LL1_SOE.Data,L25 in the source of the OPC Gateway item will return an array of 25 words with the control flag and timestamp.

The OPC Gateway destination item will be something like IOServer\DNPSlaveAB_12.1.2.015.state, the "Write Data Type" in the Gate Item Info must be set to "BSTR" so that the data is copied as a string.

For debugging, if you turn on IOServer.Log File.Log OPC calls, you will see something like
Write type(x) length(25) size(2) ExtractTime str(1:2002:02:02-12:13:14.678)

If the conversion is unsuccessfully then it will show
ExtractTime str(1:2002:02:02-12:13:14.6789) year(2002) month(2) day(2) hour(12) min(13) sec(14) ms(6789)
This conversion fails because ms must be less than 1000

Each word contain a single character.

Word refer a unsigned or signed 16-bits integer.

The OPC Gateway uses IOPCAsyncIO3:WriteVQT to copy the value, quality and timestamp to the destination tag.

If you want to copy the following information to Device1.1.2.1.State in the DNP3 slave
SISCO.AXS4ICCP.3\UtilitySiteB:DateValue~VAR1.State is an integer value of 0 or 1
SISCO.AXS4ICCP.3\UtilitySiteB:DateValue~VAR1.TimeStamp is a VT_BSTR string of "07-27-2016 14:49:32.735"
SISCO.AXS4ICCP.3\UtilitySiteB:DateValue~VAR1.Quality is an integer of 0. A non zero value indicates bad quality

Then you configure the following OPC Gateway time to copy the source VTQ values into the DNP3 slave object
Source Expression: stradd(stradd(strfmt("%.0f:", SISCO.AXS4ICCP.3\UtilitySiteB:DateValue~VAR1.State), SISCO.AXS4ICCP.3\UtilitySiteB:DateValue~VAR1.TimeStamp)­,strfmt(":%.0f", SISCO.AXS4ICCP.3\UtilitySiteB:DateValue~VAR1.Quality))
Destination: Device1.1.2.1.State

© Copyright IOServer Pty Ltd. All rights reserved.
+61 2 9805 0356 (Australia)

Last updated: Thu, 16 Jun 2022 08:01:57 GMT