Hello,
I am new DNP3 and this is my first project using opendnp3. Beautiful code, and it is a pleasure to use its interfaces to integrate it into the host application.
I have an Outstation app, implementing 3 Counters (Obj:22, Var:05), 3 Analog (Obj:32, Var:08), and 3 Binary Input (Obj:02, Var:02). According to my reading of the specs, they should all report their values together with the time stamp.
Wireshark shows the Binary Inputs report data as expected, but the Counters and Analogs report the correct values with the wrong time fixed to “Timestamp: (0)Jan 1, 1970 00:00:00.000000000”:
[1 DNP 3.0 AL Fragment (123 bytes): #13(123)]
Application Layer: (FIR, FIN, CON, UNS, Sequence 15, Unsolicited Response)
Application Control: 0xff, First, Final, Confirm, Unsolicited(FIR, FIN, CON, UNS, Sequence 15)
Function Code: Unsolicited Response (0x82)
Internal Indications: 0x0000
RESPONSE Data Objects
Object(s): 32-Bit Counter Change Event with Time (Obj:22, Var:05) (0x1605), 2 points
Qualifier Field, Prefix: 2-Octet Index Prefix, Range: 16-bit Single Field Quantity
Number of Items: 2
Point Number 0 (Quality: Online), Count: 33, Timestamp: (0)Jan 1, 1970 00:00:00.000000000
Point Number 2 (Quality: Online), Count: 99, Timestamp: (0)Jan 1, 1970 00:00:00.000000000
Object(s): 64-Bit Floating Point Change Event w/ Time (Obj:32, Var:08) (0x2008), 3 points
Qualifier Field, Prefix: 2-Octet Index Prefix, Range: 16-bit Single Field Quantity
Number of Items: 3
Point Number 0 (Quality: Online), Value: 33, Timestamp: (0)Jan 1, 1970 00:00:00.000000000
Point Number 1 (Quality: Online), Value: 66, Timestamp: (0)Jan 1, 1970 00:00:00.000000000
Point Number 2 (Quality: Online), Value: 99, Timestamp: (0)Jan 1, 1970 00:00:00.000000000
Object(s): Binary Input Change With Time (Obj:02, Var:02) (0x0202), 3 points
Qualifier Field, Prefix: 2-Octet Index Prefix, Range: 16-bit Single Field Quantity
Number of Items: 3
Point Number 0 (Quality: Online), Value: 1, Timestamp: Jun 22, 2021 19:37:01.216000000
Point Number 1 (Quality: Online), Value: 1, Timestamp: Jun 22, 2021 19:37:01.216000000
Point Number 2 (Quality: Online), Value: 1, Timestamp: Jun 22, 2021 19:37:01.216000000
I use Opendnp3 v3.1.0.
Is there anything I am missing to get the correct timestamp?
Thank you,
Ovidiu Adam
Never mind, I have figured it out.
Thanks,
Ovidiu
--
You received this message because you are subscribed to the Google Groups "opendnp3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automatak-dnp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automatak-dnp3/ccad39a1-979a-46c0-81ca-59626d8bb292n%40googlegroups.com.
Hi Sean,
The library does not provide the timestamps. The application needs to provide them together with the values posted to the master, by invoking the constructor with the DNPTime time parameter for the Counter, Analog, Binary, … classes. Those are all declared in cpp\lib\include\opendnp3\app\MeasurementTypes.h
To view this discussion on the web visit https://groups.google.com/d/msgid/automatak-dnp3/63d17d4b-3770-42c5-9232-10fa15c8a3a3n%40googlegroups.com.
My original problem, which I understand you have just hit, is that a timestamp of “(0)Jan 1, 1970 00:00:00.000000000” comes from the outstation to the master over this wire.
Hi Sean,
The library does not provide the timestamps. The application needs to provide them together with the values posted to the master, by invoking the constructor with the DNPTime time parameter for the Counter, Analog, Binary, … classes. Those are all declared in cpp\lib\include\opendnp3\app\MeasurementTypes.h
Ovidiu
From: automat...@googlegroups.com [mailto:automat...@googlegroups.com] On Behalf Of Sean Mackey
Sent: Thursday, November 04, 2021 1:15 PM
To: opendnp3
To view this discussion on the web visit https://groups.google.com/d/msgid/automatak-dnp3/63d17d4b-3770-42c5-9232-10fa15c8a3a3n%40googlegroups.com.
Note that in Adam’s example the AddUpdates(…) function, case ('c') invokes builder.Update(Counter(state.count), 0);
If that counter is configured to use event variations that have a time, then the outstation will put on the wire Timestamp: (0)Jan 1, 1970 00:00:00.000000000.
To have the correct timestamp on the wire, that invocation needs to be changed like: builder.Update(Counter(state.count, Flags(0x01), app->Now()), 0);
Ovidiu
To view this discussion on the web visit https://groups.google.com/d/msgid/automatak-dnp3/dfcb5e8c-9fb5-4f17-9a16-b62d3c580803n%40googlegroups.com.