Hello, I have a service/script running which controller some relays. I would like to turn OFF the relays during loss of power. I referred to the 'How to execute commands before the Raspberry Pi industrial PLC Power Off process' and created the pre-poweroff with the following content.
#/home/pi/.local/bin/uv run python
from librpiplc import rpiplc
rpiplc.init("RPIPLC_V4", "RPIPLC_38AR")
rpiplc.digital_write("R1.1", rpiplc.LOW)
rpiplc.digital_write("R1.2", rpiplc.LOW)when I run the python script on it own it does turn OFF the relays.
when I unplug the power, I do see the relays going off. not sure if its because of the script or loss of power of the relay.
But when I turn the RPI PLC back on the relays are in ON state.
i would like to keep the relays OFF during power up no matter what the previous states are before loss of power.
any help in this matter would be greatly appreciated. thanks.