power switch toogle with pendant

More
16 Mar 2021 03:38 #202443 by mb_cnc
Hello, I've been working on a physical momentary switch for toggling machine power and I have it working but when adding a second device to do the same (xhc-wbo4b-6 pendant) I'm getting "can not add output Pin" error. I think I understand the error just not sure the fix.

thanks


main.hal
net machine.is-on halui.machine.is-on
net machine.on halui.machine.on
net machine.off halui.machine.off

whc-whb04b-6.hal
net machine.is-on whb.halui.machine.is-on
net machine.on whb.halui.machine.on
net machine.off whb.halui.machine.off

custom_postgui.hal
loadrt toggle count=1
loadrt toggle2nist count=1
addf toggle.0 servo-thread
addf toggle2nist.0 servo-thread

#machine power on toggle button
net power-on-btn toggle.0.in hm2_7i76e.0.7i76.0.0.input-15
net toggle-button toggle2nist.0.in toggle.0.out

net machine.is-on toggle2nist.0.is-on hm2_7i76e.0.7i76.0.0.output-00
net machine.on toggle2nist.0.on # error on this line
net machine.off toggle2nist.0.off # error on this line

Please Log in or Create an account to join the conversation.

More
16 Mar 2021 07:50 - 16 Mar 2021 07:57 #202457 by Aciera
The problem is that you are trying to wire two different "out" pins to the same signal: machine.on and machine.off respectively.
You could try and use an 'or2' component to connect the two sources to toggle the signal.
loadrt or2
addf or2.0 servo-thread

net button-1 or2.0.in0 <= hm2_7i76e.0.7i76.0.0.input-15
net button-2 or2.0.in1 <= your button on the pendant
power-on-btn toggle.0.in <= or2.0.out
Last edit: 16 Mar 2021 07:57 by Aciera. Reason: Got it all wrong the first time around.

Please Log in or Create an account to join the conversation.

More
18 Mar 2021 01:05 #202691 by andypugh
I think this might be a job for toggle-to-nist
Possibly with two buttons or-ed together.

You can also do this with LUT5 Which is a really useful component especially when you feed the output to one of the inputs (as you would need to do for this job).

LUT5 will either make perfect sense to you immediately, or not. But it would allow up to 4 buttons to toggle the state, with the additional flexibility that some could be set up as on-only and some as off-only.

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum