drbitboy
Lifetime Supporting Member
During my testing last night when I would press the e stop the plc would fault out of course. DS1 would still not be = to DS2. So as soon as the fault was reset the CW motion would try to start. With the c10 in place it wouldn't let it. So that would give me a chance to move the machine to a safe position, fix what I programmed wrong, then restart the T.C. sequence.
It's not necessary to eliminate the separate C10 start signal, but it does make the system less complex.
TL;DR
N.B. I am not saying remove the rising edge instruction, of C10 in Rung 12, that starts CW motion and the rest of the sequence.
I am saying replace C10 with C2 in that rising edge instruction.
So it's easy to test by changing "C10" to "C2" on Rung 12; you don't even have to remove the Modbus Receive instruction that writes to C10 to run the test.
Because I am all but certain that
- when the target tool (DS1) is updated via the Modbus transfer successfully,
- C2 will always have a rising edge as the indicator of that success.
- And, the way the lua code is written, that C2 rising edge will be just before C10 gets its rising edge from the second Receive.
- C2 will not have a rising edge,
- and the lua code will also not send a 1 to C10.
On recovery from an e-stop fault, the lua code will not automatically send any Modbus messages, so neither C2 nor C10 will have a rising edge. So even if DS1 (target tool) was not equal to DS2 (current tool) when the e-stop fault reset occurred, that reset would not cause CW motion and the tool search to start.