mlanden
I have the attached program that has a variable named pressure_release mapped to a free modbus coil. When the variable is high, I want the enable_bypass to be set, triggering the bypass_valve to be set, which triggers a relay output on a unipi to be set. However , whenever I write to the modbus coil, the relay is not set. I've tried using a slave device with no success. I also tried writing to the modbus coil of the relay output directly when openplc is running and it will not go high either. 
 
I thought maybe something in the logic is overriding it and countering the modbus, but I can't find anything. 
 
Is there any reason why I cannot get the relay output to be high?
Reply 0 0
thiagoralves
Couple things to consider:
1. Make sure you're using the right Modbus address for pressure_release.
2. You might consider changing your pressure_release contact to "rising edge", so that a modbus write won't hold that contact true forever
3. Use the simulation tool to evaluate your program, forcing signals to make sure you achieve the result you want.
Reply 0 0
mlanden
Thanks. I am able to see in monitoring that pressure_release goes high when I send the modbus command. I also saw that in simulation, the expected functionality works. Is there a way to run the simulation interface, but have it running on the plc? I'm not sure how else to debug this issue. 
Reply 0 0
thiagoralves
No, you can’t hook the simulation up with the PLC. Does the related relay goes high on monitoring as well?
Reply 0 0
mlanden
No, you can’t hook the simulation up with the PLC. Does the related relay goes high on monitoring as well?
No, it does not go high on monitoring.
Reply 0 0
thiagoralves
If it doesn’t go high on monitoring then it is in fact your logic that is keeping it low. On simulation click on the glasses next to the variable you want to monitor, and then double click on the variable at the debug panel to see its graph over time. This might help you debug better
Reply 0 0
Reply