How to send 'clock synchronization' and 'assign class', and where to get delay measurement' and 'disable\enable unsolicited'

296 views
Skip to first unread message

Maayan Mamalya

unread,
Mar 5, 2020, 10:31:25 AM3/5/20
to opendnp3
Hello,
I have few questions about implement clock synchronization and assign class.

1. I understood that 'WriteAbsoluteTime' on IOutstationApplication is invoked after getting clock synchronization request from master.
However, I did not find the function's master to send that request, or should I just use 'master->PerformFunction' with function code: RECORD_CORRENT_TIME?

2. I have the same problem with 'Assign class'
I understood that 'RecordClassAssignment' on IOutstationApplication is invoked (only if the AupportAssignClass returns true)
However, I did not find the function's master to send that request, or should I just use 'master->PerformFunction' with function code: ASSIGN_CLASS?

In addition, I have one more question
3. I did no find (in the outstation) the functions that suppose to invoke when the master sends 'delay measurement' and 'disable\enable unsolicited' 
Could you please tell me what are they? (or maybe I am wrong and there are no such functions to overload?)

Any help would be appreciated.

Best regards,
Maayan

Émile Grégoire

unread,
Mar 6, 2020, 9:20:48 AM3/6/20
to opendnp3
Hi Maayan,

Here are the answers to your questions:

1. OpenDNP3 does automatic time synchronization when it receives a response with IIN NEED_TIME set. On LAN network, it will send the RECORD_CURRENT_TIME followed by a write with the proper g50v3 where the time is extracted from the IUTCTimeSource. By default, it uses the system clock as its source. Note that IMasterApplication implements IUTCTimeSource, so you can override it with your own timesource. OpenDNP3 currently does not support initiating a manual time synchronization. Sending a RECORD_CURRENT_TIME with a PerformFunction will serve no purpose.

2. Yes, you can assign class by sending a PerformFunction with ASSIGN_CLASS and the proper headers, see IEEE 1815-2012 section 4.4.14 for details about the headers to send. However, instead of sending the class assignements manually, we highly recommend that you use the mechanism provided by IMasterApplication. Simply return true in AssignClassDuringStartup and override ConfigureAssignClassRequest to write the proper headers. With this functionality, the class assignements are sent everytime a connection is made to the outstation, so you don't have to worry about following the state of the outstation.

3. When a DELAY_MEASURE is sent, the master will follow with a write of g52v1 with the current time in it. This time will be sent to IOutstationApplication::WriteAbsoluteTime handler, just like a LAN time sync. Enable/Disable unsolicited responses is entirely handled internally by OpenDNP3, there's no callback for them. You can have a look at the internal details here: https://github.com/dnp3/opendnp3/blob/44c06cb148d40ed150e539895b3fa951376e5f74/cpp/libs/src/opendnp3/outstation/OutstationContext.cpp#L680-L704

Regards,

Émile Grégoire, CEP

Candidate to the Engineering Profession (CEP)

Software Developer

Automatak

Message has been deleted

Maayan Mamalya

unread,
Mar 15, 2020, 4:49:57 AM3/15/20
to opendnp3
Thank you for your replay!

I change my answer to be more precise:
 1. Does the mechanism provided by IMasterApplication is the the same as performFunction('assign class'...)? due to my understanding the performFunction('assign class'...) can be not only on startup. Am I wrong?
2. I overloaded 'supportAssignClass' to return true, therefore I thought 'RecordClassAssignment ' supposed to invoke, but it didn't. why? 
3. The same as question 2,  I overloaded 'SupportWriteAbsoluteTime' to return true and 'WriteAbsoluteTime ' did not invoke either, why?

Thank you again for your help!
Maayan

Émile Grégoire

unread,
Mar 22, 2020, 3:57:05 PM3/22/20
to opendnp3
Hi Maayan,

1. The PerformFunction can be used to send a class assignement at any time. The mechanism in IMasterApplication is simply a helper that automatically sets the class assignements everytime a connection is established with the outstation. It implements a common use case. It uses PerformFunction under the blanket. If you want, you can ignore it and do the class assignements yourself with PerformFunction.
2. and 3. Your callback should be called. Are you using Automatak's DNP3 simulator to send the class assignements and the time sync? If so, your callbacks won't be called because the simulator sends empty requests. They do not contain an actual class assignement or a time value, therefore the callbacks are not invoked. Try sending non-empty requests and you should get calls to your callbacks.

Regards,

Émile

Maayan Mamalya

unread,
Mar 23, 2020, 11:10:38 AM3/23/20
to opendnp3
It was very helpful! 

I did use Automatak simulator for assign class
However, for 'Delay Measurement' I tried to use with anther DNP3 simulator (https://sourceforge.net/projects/dnp3-client-master-simulator/) and the function did not invoke. So, the assumption is this simulator sends empty request, am I right? 

Also, when I tried to use Master->PerformFunction with functionCode 'DELAY_MEASURE' the result is 'FAILURE_BAD_RESPONSE'. Am I wrong by using PerformFunction?  

Thanks for the support.
Maayan

po...@spinengenharia.com.br

unread,
Nov 10, 2021, 12:16:18 PM11/10/21
to opendnp3

Mr Emile

Some times an outstation IED does not implement setting NEED_TIME bit.  THen it is necessary to send periodically the sinc procedure.

I tried using the PerformerFunction to send   RECORD_CURRENT_TIME, and it works good.

The problem is the WRITE command , because it is sendind a Group 50 var 4, instead  group 50 var 3, said by DNP3 Norm item 10.3, as the one should be sent.

We do not have another method of WRITE for me to choose and send the correct object?

Thanks

Jose Aurelio Porto
(Developer and real enthusiasted with OpenDnp3!!!)

Adam Crain

unread,
Nov 19, 2021, 12:43:17 PM11/19/21
to opendnp3
Unfortunately not, and opendnp3 is on a feature freeze.
Reply all
Reply to author
Forward
0 new messages