External button for Cycle start/pause

More
5 years 1 month ago #220697 by Kasper-001
Replied by Kasper-001 on topic External button for Cycle start/pause
Thanks it Works Now,   I´ll post the working code below so it may help others in the future :) 

# --- CYCLE-START ---
net cycle-start     <=  hm2_7i92.0.7i76.0.0.input-16 => halui.program.run

#--Pause/Resume Button---

loadrt and2 count=2
loadrt or2 count=1
loadrt toggle count=1
loadrt toggle2nist count=1

addf and2.0 servo-thread
addf and2.1 servo-thread
addf or2.0 servo-thread
addf toggle.0 servo-thread
addf toggle2nist.0 servo-thread

# External Program Pause/Resume Button
net pause-resume-btn and2.0.in0 and2.1.in0 <= hm2_7i92.0.7i76.0.0.input-17
net pause-on toggle2nist.0.is-on and2.0.in1 <= halui.program.is-paused
net run-on and2.1.in1 <= halui.program.is-running
net pause-sig or2.0.in0 <= and2.0.out
net resume-sig or2.0.in1 <= and2.1.out
net toggle-ok toggle.0.in <= or2.0.out
net togglesig toggle2nist.0.in <= toggle.0.out
net toggleon halui.program.pause <= toggle2nist.0.on
net toggleoff halui.program.resume <= toggle2nist.0.off
The following user(s) said Thank You: anfänger, den2313

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

More
1 year 6 months ago #326414 by vre
Replied by vre on topic External button for Cycle start/pause
How to do it with only 1 button that has function cycle start / pause / resume ?

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

Time to create page: 0.444 seconds
Powered by Kunena Forum