pipipie
Good evening,

Is there a way to change DNP3 settings other than what is listed in the dnp3.cfg file?

I’m hoping to get the openPLC runtime to be able to respond to polls using different object / variations than it currently seems to do out the box.

So for example I’d like changes to binary inputs to be binary input event type with time + flags.

Seems like so far the only documentation I’ve come across on the forums seems to relate to earlier versions of open PLC, and it’s changed a bit for V3.

I’ve found that in response to a class 0 poll the openPLC dnp3 slave does seems to just be aware of all the signals my hardware (pixtend) offers without actually needing to define all the variables, which is awesome, but hopefully can be tweaked somewhere. I’ve looked through the files and cant see any obvious candidates. Does this require changes to part of the openDNP3 files before compilation maybe?

Or perhaps I need to do something with a RTC block and a variable in the editor?

Appreciate any hints on where to look.

Edit to clarify, the time stamped responses would be to class 1 polls, not class 0 🙂

Thanks.
Reply 0 0
pipipie
So seems like it *should* be possible by putting something in to the dnp3.cpp before compiling... I just cant seem to get the syntax correct.

Looked through some of the openDNP3 forums and found how to set the default variations when instantiating the outstation, but when I try to add lines it doesn't seem to be finding the structure. Not sure how to get he correct reference path for the object I'm setting.

I know nothing about c++ so my programming style is infinite monkey style... stick random code in and try compiling 🙂

I believe it will be something along the lines of, but this isn't right:
config.binary_input[0].evariation = EventBinaryVariation::Group2Var2;


Here's one of the places I'm referencing:
https://github.com/dnp3/opendnp3/blob/release/cpp/examples/outstation/main.cpp#L42
Reply 0 0
pipipie
I can 'force' G2, Var 2 by changing /usr/local/include/opendnp3/app/MeasurementInfo.h DefaultEventVariation to be Group2Var2. 

Now I need to figure how to get the DNP3 stack to accept the timestamp (its currently giving 1/1/1970 00:00:00).
 
Reply 0 0
thiagoralves
I haven't played with DNP3 in a while, so I don't know if I can be of much help. However, the timestamp you see is zero epoch (number of seconds since 1/1/1970). There should be a place somewhere where you can insert the correct epoch timestamp. You can easily grab current epoch timestamp in C using the time.h library:  https://www.tutorialspoint.com/c_standard_library/c_function_time.htm
Reply 0 0
pipipie
The opendnp3 function seems to need the time stamp in the DNPtime format (defined another class elswehere) which isn't directly compatbile with the standard c time. I think I manged to at least get the current time in to a variable, but cannot seem to convert DNPtime.

Think I need to learn a bit more about c++ before I'll solve this 🙂
Reply 0 0
Reply