nOOb
Hello, I am new to all this. I have Modbus down master/slave talking etc. But if there any info on setting up DNP3? thanks.
Quote 0 0
nOOb
Is there a Mapping to the memory for DNP3?
Quote 0 0
thiagoralves
The DNP3 mapping is similar to the Modbus one. The following table is a comparison of Modbus and DNP3 data types
Capture.png 

Not all DNP3 data types were implemented in OpenPLC. The implemented ones are:

Binary Input: the mapping is exactly the same as Modbus Discrete Input, i.e. %IX0.0 = address 0, %IX0.1 = address 1, and so on...
CROB: the mapping is exactly the same as Modbus Coils, i.e. %QX0.0 = address 0, %QX0.1 = address1, and so on...
16-bit Analog Input: the mapping is exactly the same as Modbus Input Registers, i.e. %IW0 = address 0, %IW1 = address 1, and so on...
16-bit Analog Output Block: the mapping is exactly the same as Modbus Holding Registers, i.e. %QW0 = address 0, %QW1 = address1, and so on...
32-bit Analog Output: the mapping follows OpenPLC's General 32-bit Register mapping, i.e. %MD0 = address 0, %MD1 = address1, and so on...
32-bit Floating Point Output: this mapping follows the same General 32-bit Register mapping, i.e. %MD0 = address 0, %MD1 = address1, and so on... This means that 32-bit Analog Out and 32-bit Floating Point out are mapped to the same memory region.
64-bit Floating Point Output: the mapping follows OpenPLC's General 64-bit Register mapping, i.e. %ML0 = address 0, %ML1 = address1, and so on...
Quote 0 0
nOOb
Wonderful thanks ! First awesome  software and thanks.  I was trying to get OpenPLC and scadaBR talking using  DNP3, works great with modbus but dnp3 causes an error. I know this isn't the place to get answers for scadaBR, but just in-case anyone else runs into a problem, or anyone else has had the issue and has fixed it,  it tosses an Invalid Application frame received! line 270 in the their code. maybe I am linking them wrong. Thanks again
Quote 0 0
thiagoralves
What version of ScadaBR are you using? I just created a simple test where I read one output bit and it works perfectly. You need to make sure that your ScadaBR configuration matches the configuration in the dnp3.cfg file inside your OpenPLC_v2 folder. Also, make sure that you're selecting DNP3 IP on the Data Source type. OpenPLC doesn't support DNP3 Serial yet.

Capture4.png
Quote 0 0
nOOb
Yup I was using DNP3 ip   10 , 1  and host IP. I am using scadaBR 1.0, OpenPLC is running on linux, scadaBR is running on windows.  what  is settings you have on openplc  class: local  type:Boolean location: %QX0.0 ?
Quote 0 0
nOOb
Also, I don't get any errors displayed on ScadaBR. When you go to view the point; the little eye and add it to the watch list is just says (n/a) for the reading of the point. In the logs folder it will display the error if you run tomcat in debug reporting mode.  Also if you change true or false using scadaBR in the watch list and scan it using the modbus tool it doesn't change the respected coil. Like I said I might be doing something wrong. But currently I should have a binary output referencing  %&QX0.0 which is my button for the lamp no errors in the interface but it doesn't change the coil or display the coil info. which I am also scanning using their modbus options.
Quote 0 0
nOOb
Okay the binary output does control coils, I stand corrected I guess I did something wrong. With the analog out  if you create two analog out blocks hold UINT at locations %QW0 and %QW1 and if I am understanding this correctly they are both 16 bits each, when I create two analog output to reference those in scadaBR I put index 0 for one and index 1 for the next, when i change them using scadaBR they both change the value at index 0 never touching the block at 1, also the second analog  out cannot read the block at index 1. Sorry again I am new to this. But I do have the coils function, thanks. I appreciate your time I know your probably crazy busy.
Quote 0 0
thiagoralves
The problem you had with your coils is probably related to ladder logic. OpenPLC gives priority to ladder logic, therefore if you try to write to a coil using Modbus or DNP3, if this particular coil is controlled by your ladder logic, the ladder logic will prevail over whatever you wrote. This is the case with the Hello World example project and the coil %QX0.0 (Lamp). Ladder logic says it should stay off all the time, unless the button goes high. If you try to write to that coil, it will remain off because that’s what the ladder logic is saying.

About your issue with the Analog output addresses, all tests I made with analogs a while ago went well. I’ll redo them whenever I have some time and will let you know.
Quote 0 0
nOOb
Yes thanks, that was the issue with coil, appreciate it. While I wait on your response on the analogs I will continue to check and see if I am doing something wrong. again thanks for taking the time to help me.
Quote 0 0
nOOb
Hello again, So here is  where I am at  OpenPLC and scadaBR works great in modbus.  But DNP3 has some issues. First I have the basic hello project going. the button is mapped to %Qx0.1 and the lamp is mapped to %QX0.0 , so the button should be able to be controlled. In scadaBR I set a point to binary output index 1 for the button and index 0 for  the lamp they are both set to latch on/off. I get no error message, but when you go to your watch list they both show (n/a). Now if you read the coil using their modbus section it comes up false,  When I use the button point in the watchlist to change the state to lon(on) the display changes to true but the lamp still says (n/a). Now if I scan again using the modbus its show both  reg 0 and reg 1 are true. Also, when I change it using modbus the DNP3 doesn't change. It is controlling it but it isn't displaying the coils. Thanks again for your time.
Quote 0 0
thiagoralves
It might be possible that ScadaBR is having issues with DNP3 then. I've used OpenPLC with a commercial DNP3 tester tool and it passed all the tests. Are you using ScadaBR v1.0 CE?
Quote 0 0
nOOb
Yes I am thinking its on there end as well, I just wanted to make you aware of it. I believe I located the problem to the section of code that I had mentioned above.
Quote 0 0
nOOb
I am using 1.0.
Quote 0 0
nOOb
I think I might have found the problem. I was using it with another program and it hit object 50 (time and date) and runs into errors. My thought is, if I add a RTC block it might fix the issue.
Quote 0 0