trouble with set-points control from master

335 views
Skip to first unread message

Michał Kot

unread,
Jul 16, 2013, 10:52:08 AM7/16/13
to automat...@googlegroups.com
Hello everyone ,

i have problem with master application.
I have compiled master and slave simple demo program both for ix86 and ARM.
controlling analog inputs directly from slave works well, but i have problems to control ralay and analog outputs from master - when i tried to change registry  from written test program and dnp3 master simulator nothing changes.  
I tried to use both Select and Operate and DirectOperate functions on CROB and AnalogOutput

Master code was :
ControlRelayOutputBlock crob(CC_LATCH_ON); promise<CommandResponse> selectResult; pCmdProcessor->SelectAndOperate(crob, 1,[&](CommandResponse cr){ selectResult.set_value(cr); }); CommandResponse rsp = selectResult.get_future().get();

Slave was created on default configuration:

DeviceTemplate device(5, 5, 5, 5, 5);
stackConfig.device = device;

  I compiled DNP3 library for TI PandaBoard (OMAP ARM ) and communication with reading registry values works well.
The main problem is with writting registry values from master. The same situation was on PC and ARM 

Could you tell me what may be wrong with that code.
Best regards

J Adam Crain

unread,
Jul 16, 2013, 4:52:40 PM7/16/13
to automat...@googlegroups.com
Hi Michal,

The example outstations doesn't do anything with setpoints it receives:


The demo merely ACKS all setpoint requests. The 3rd argument in the method call above specifies the interface that processes control requests. In this case it's a singleton that responds SUCCESS for all requests.

If you want to implement your own command handler that actually does something like load an analog output status value, you'll need to create and pass in your own implementation of this class:


regards,
Adam

Michał Kot

unread,
Jul 30, 2013, 2:42:46 AM7/30/13
to automat...@googlegroups.com
Hi Adam,

i have created my own implementation with Select and Operate funtions for whole types of data in slave.
I made tests with master created with your library(as it is seen in demo) - it works fine - outstation respond for all types of commands.
The problem is when i want to test my outstation with any other DNP3 master.
I tried to test with DNP3 Master and outstation doesn't respond for select and operate.
I checked it also with DNP3 <-> OPC gateway. It's look like outstation has 12.1.(0-9) and 41.1.(0-9) registers, but none of them has any value,
I have following questions :
1. question - if there is any variables in config which can help to set up r/w communication between master and slave
2. question - do you know any good software to test communication between master and slave - to simulate master. I need to have sure, that i can read  and write variables to outstation

Thank you for any help.
Michal

J Adam Crain

unread,
Jul 30, 2013, 9:34:45 AM7/30/13
to automat...@googlegroups.com
Hi Michal,

Please post your code in a repository, I will be able to help.

The Group12Var1 and Group41Var1 types will not have measurements that you can read by default. They are just slots for the outstation to receive commands.  If you're aren't mapping these requests back to some measurement type you won't see any values change.

If you want to verify communications with a 3rd party master, I'd recommend grabbing a trial download of something like this:


There are also OPC trials from Kepware and Matrikon that speak DNP3.

-Adam

Michał Kot

unread,
Jul 30, 2013, 4:21:16 PM7/30/13
to automat...@googlegroups.com
https://github.com/m13kot/dnp3/blob/patch-1/IOHandler
https://github.com/m13kot/dnp3/blob/master/PifaceRTU

as example i used yours pifaceRTU

I use socket to get data from other program and send it to/from DNP3.

Michał Kot

unread,
Jul 30, 2013, 5:31:10 PM7/30/13
to automat...@googlegroups.com
Today i have checked it with Kepware, Cybectech and catapult OPC<->DNP gateways.
 
all of them read correctly analog inputs from DNP outstation, but in all of them there were problems with outputs... i tried to check with printf outputs and also breakpoints in gdb/eclipse ( program doesn't get to Operate method )

I would be glad for help..

J Adam Crain

unread,
Jul 30, 2013, 6:02:40 PM7/30/13
to automat...@googlegroups.com
Hi Michal,

That's a surprising result...

Can you change the log level to LEV_INTERPRET and provide me with a frame trace that shows the incoming control requests?

-Adam

Michał Kot

unread,
Jul 31, 2013, 12:10:20 PM7/31/13
to automat...@googlegroups.com
That was values writing to analog output an Binary output
trace2.txt
LOG.txt

Michał Kot

unread,
Jul 31, 2013, 12:16:37 PM7/31/13
to automat...@googlegroups.com
And i have informations from OPC<->DNP gateway that AO is not OK (?).
As attachement
control-logs.log

J Adam Crain

unread,
Jul 31, 2013, 1:32:58 PM7/31/13
to automat...@googlegroups.com
Michal,

I hear what you are saying, but neither of those 2 packets traces show any control messages (i.e. select or operate on Group12Var or Group40VarX).

What I see is a rotating set of Class1,2,3 event polls. That's it.

What are you doing to induce the Cybectec gateway to send s control message? This usually requires manual operation.

-Adam

Michał Kot

unread,
Jul 31, 2013, 1:39:21 PM7/31/13
to automat...@googlegroups.com
For every AO point i have
DNP31.DNP3 AO 1
DNP31.DNP3 AO 1_Cmd
DNP31.DNP3 AO 1_Res

I tried to write some values to each of setpoint  AO, AO_Cmd are R/W  _res is only R

I also attach screenshot from OPC browser.
opc.jpg

Michał Kot

unread,
Jul 31, 2013, 1:45:18 PM7/31/13
to automat...@googlegroups.com
and the last one screen.... ;)
opc_write.jpg

J Adam Crain

unread,
Jul 31, 2013, 1:51:25 PM7/31/13
to automat...@googlegroups.com
I am not familiar with OPC server configuration.  I would download a test set trial from Triangle Microworks or ASE and try it out.

These programs are much more simple and direct in terms of sending commands.

Until I can see a packet log showing a command message coming in, there's not a lot I can do to help.

Adam

Michał Kot

unread,
Jul 31, 2013, 1:56:44 PM7/31/13
to automat...@googlegroups.com
i had problems to test it with Triangle . could you send me name of ASE software ?

Michał Kot

unread,
Jul 31, 2013, 1:57:38 PM7/31/13
to automat...@googlegroups.com
problems with install triangle... not test...

J Adam Crain

unread,
Jul 31, 2013, 1:58:45 PM7/31/13
to automat...@googlegroups.com
Understood.


They have a .NET based test harness that you can try.

-Adam

J Adam Crain

unread,
Jul 31, 2013, 2:00:18 PM7/31/13
to automat...@googlegroups.com
Also, what version of windows are you running? I have had trouble installed the Cybectec OPC trial on Win7 and WindowsXP.

On XP (which it claims it supports) the installer starts but then says "be sure you have at least 64MB of memory".

I'm running it in a VM with 4GB allocated.

-Adam

Michał Kot

unread,
Jul 31, 2013, 2:03:58 PM7/31/13
to automat...@googlegroups.com
i have installed it on virtual box on ubuntu with 200mb allocated memmory. there were no info about errors...

J Adam Crain

unread,
Jul 31, 2013, 2:06:58 PM7/31/13
to automat...@googlegroups.com
Hilarious. I just dropped my memory from 4GB -> 512MB and now the installer runs fine.

I guess there's a 32-bit integer error in the installer and it refuses to install on modern systems.

Can you attach your Cybectec config file?

-AC

Michał Kot

unread,
Jul 31, 2013, 2:13:42 PM7/31/13
to automat...@googlegroups.com
...and winXP.   i'm going to try it with ase.

Michał Kot

unread,
Jul 31, 2013, 3:58:36 PM7/31/13
to automat...@googlegroups.com
as attachement
ActiveConfiguration.par

Michał Kot

unread,
Jul 31, 2013, 5:58:13 PM7/31/13
to automat...@googlegroups.com
I have tried with ASE 1.43 Trial
there are also no breakpoints during execution. (::Operate,  ::Select)
i have no idea why this doesn't respond..
ASE.cpt
ASE StdIO_log.txt

Michał Kot

unread,
Aug 1, 2013, 3:30:47 PM8/1/13
to automat...@googlegroups.com
Hi Adam,
Had you time to check communication with that opc? Is it my fault in program, or problem is somwhere else?
Best regards

J Adam Crain

unread,
Aug 1, 2013, 3:47:44 PM8/1/13
to automat...@googlegroups.com
Hi Michal,

I have a work deadline tomorrow AM.  I probably wont' have a chance to look at this until tomorrow.

Thanks for your patience with this. I promise the controls work in the library, we'll figure it out

-Adam

Michał Kot

unread,
Aug 4, 2013, 6:11:18 PM8/4/13
to automat...@googlegroups.com
Ok, i think i have solved my problem ;)

J Adam Crain

unread,
Aug 4, 2013, 8:57:14 PM8/4/13
to automat...@googlegroups.com
What was the resolution?

Michał Kot

unread,
Aug 6, 2013, 3:47:38 PM8/6/13
to automat...@googlegroups.com
when i add header opendnp3 (Ichannel, IOutstation)  files to PifaceIOHandler.cpp it starts to work...

I have two more questions :
- how to change from int to float for AnalogInputs
- if there is any information about status of AnalogOutput - in one of OPC gateway i get information that i can't Operate on output because the state isn't ok.

J Adam Crain

unread,
Aug 7, 2013, 10:02:07 AM8/7/13
to automat...@googlegroups.com
Hi Michal,

The library always reports the type that the master requests and default to certain types for Class polls and any other poll that doesn't specify the type. You can change the default types here:


With regard to analog output status, you'll have to change these measurements when you receive the control.  As I just mentioned to Frank, these values don't support event reporting at the moment.

-Adam
Reply all
Reply to author
Forward
0 new messages