Toggle Flood with One Button
# Flood Coolant Toggle net coolant-btn and2.0.in0 <= pyvcp.coolant net coolant-ok and2.0.in1 <= halui.machine.is-on net coolant-request toggle.0.in <= and2.0.out net coolant-toggle toggle2nist.0.in <= toggle.0.out net coolant-is-on toggle2nist.0.is-on <= halui.flood.is-on net coolant-on halui.flood.on <= toggle2nist.0.on net coolant-off halui.flood.off <= toggle2nist.0.off
The image shows the basic connections. It breaks down like this:
If the button is pushed AND the machine is on then input to toggle is on.
When toggle input is on change the output state
When toggle out is on toggle2nist input is on.
When toggle2nist in changes states
If coolant is on output off
If coolant is not on output on
for my led to change. but other then that, it works.
THANKS John !
will be testing to see it gets out of sync anywhere.
net power-btn and2.11.in0 <= pyvcp.on-off
net power-ok and2.11.in1 <= halui.program.is-idle
net power-request toggle.4.in <= and2.11.out
net power-toggle toggle2nist.2.in <= toggle.4.out
net power-is-on toggle2nist.2.is-on <= halui.machine.is-on
net power-on halui.machine.on <= toggle2nist.2.on
net power-off halui.machine.off <= toggle2nist.2.off
Not sure that I would use halui.program.is-idle for your power on/off as it is true even if the e-stop is active which means you can't turn the power on in that state. I would use halui.estop.is-activated with a not to invert the state of the pin as part of my and2.
cool. i'll try that.