garretfick
Hi,

I'm trying to adapt the HelloWorld application to demonstrate how to communicate with OpenPLC via DNP3 using Python (similar to what I wrote for Modbus https://www.ficksworkshop.com/blog/openplc-helloworld).

I think I'm getting stuck in my knowledge of DNP3, but might be missing something bigger. What I have so far is the standard HelloWorld with mappings PB1 -> %IX0.0, PB2 -> PB2, LED -> LED. I've also added a %QX0.2 with an initial value to prove a simple constant value (1).

When I use pydnp3 to read group 10, variation 2, I can correctly see %QX0.1 is true, so I'm confident I can read the outputs. (I can also see it in the TMW simulator.)

I cannot figure out how to write to the inputs. Should I be writing to group 1, variation 1?  https://openplc.discussion.community/post/dnp3-9658843 makes me thinks that's the case, but there don't seem to be APIs in opendnp3 to do this, which makes me think I'm not understanding something.

Any thoughts on this would be very much appreciated.

(For interest, the the steps I've followed are on github, but not published yet because it doesn't yet work. https://github.com/garretfick/garretfick.github.io/blob/master/_posts/_2019-03-08-openplc-dnp3-master.md)
Quote 0 0
thiagoralves
By protocol definition, you cannot write to inputs. Inputs are read-only and reflect the state of your physical inputs. That is also true for Modbus. Since you're running this on Linux, you don't have any physical inputs, so they are all zero. For this program to work (based on a soft-PLC), you will have to locate your button in %QX-something. Then you can use the write-output instructions to control it.
Quote 0 0
garretfick
Thanks. I had a feeling that might be the answer. 🙂
Quote 0 0