jbuening
Is it possible to write to OpenPLC registers from another system.  I setup a simple program and was able to also setup ScadaBR to read from it, but have not been able to use ScadaBR to set coil register values.

Do I need a modbus master workstation to do this?

For example, I want to directly set one of the lamp states in the program below, or directly manipulate R1.

Capture.png
Reply 0 0
thiagoralves
Ladder logic has precedence over Modbus writes. You can write to coils and registers using Modbus, however, if what you are writing conflicts to what ladder logic is writing, ladder logic will prevail. From your diagram above, trying to write directly to lamp0, lamp1 or lamp2 won't work, because ladder logic says that those coils only turn on when R1 is on.

The right way would be to write to R1, which then would turn on all the three lamps. However, I see from your variables list that R1 has no localizable address. Using Modbus you can only reach localized variables. Just give R1 an address that is not being used (%QX0.3 for example) and then it will be available as Modbus coil address 3.

Again, since ladder logic has precedence over Modbus, writing to R1 will only work if stop is false. If you press the stop button, R1 will remain false no matter if you're writing it to be true using Modbus.
Reply 0 0
jbuening
Thanks for the reply!  Interesting to learn more about all this and ladder logic.  Do the other programming standards also take precedence over Modbus, or are there some where this scenario would work?
Reply 0 0
thiagoralves
It’s the same with all languages. Whatever logic the PLC is running has precedence over network commands.
Reply 1 0
Reply