User panel component for start / feed hold / stop
08 Mar 2023 12:34 #266113
by TOLP2
User panel component for start / feed hold / stop was created by TOLP2
Created a small component for the user panel on my EMCO5-to-become. The machine has a small user panel with three buttons with indicator lights. The three buttons are labelled:
Maybe someone finds it useful for their machine.
- start: should start the GCode if any is loaded;
- pause / feed-hold: when active, it pauses the current program. When paused, one can step through the program by pressing the start button;
- stop: stops any program currently active.
- button/mode is enabled: on;
- button/mode is active: blinking (e.g. the start button is blinking when a program is running);
- button/mode is disabled: off.
Maybe someone finds it useful for their machine.
Attachments:
Please Log in or Create an account to join the conversation.
08 Mar 2023 13:19 #266115
by TOLP2
Replied by TOLP2 on topic User panel component for start / feed hold / stop
An example on how to use this component:
loadrt emco5_userpanel count=1
loadrt pwmgen output_type=type0
addf emco5_userpanel.0 servo-thread
addf pwmgen.make-pulses servo-thread
addf pwmgen.update servo-thread
# Status from halui
net is-idle emco5-userpanel.0.is-idle <= halui.program.is-idle
net is-paused emco5-userpanel.0.is-paused <= halui.program.is-paused
net is-running emco5-userpanel.0.is-running <= halui.program.is-running
# Status whether program is loaded
net is-gcode-loaded emco5-userpanel.0.is-gcode-loaded <= gmoccapy.program.length
# Connect the buttons
net is-start-pressed emco5-userpanel.0.is-start-pressed <= EMCO5.gpio.start_button.in
net is-pause-pressed emco5-userpanel.0.is-pause-pressed <= EMCO5.gpio.pause_button.in
net is-stop-pressed emco5-userpanel.0.is-stop-pressed <= EMCO5.gpio.stop_button.in
# Export the actions to the halui
net pause emco5-userpanel.0.pause => halui.program.pause
net resume emco5-userpanel.0.resume => halui.program.resume
net run emco5-userpanel.0.run => halui.program.run
net step emco5-userpanel.0.step => halui.program.step
net stop emco5-userpanel.0.stop => halui.program.stop
# Connect the status LEDs
net start-status-LED emco5-userpanel.0.start-status-LED => EMCO5.gpio.start-LED.out
net pause-status-LED emco5-userpanel.0.pause-status-LED => EMCO5.gpio.pause-LED.out
net stop-status-LED emco5-userpanel.0.stop-status-LED => EMCO5.gpio.stop-LED.out
# Signals for disabled (OFF/FALSE), enabled (ON/TRUE) and active (BLINKING -> PWM) buttons.
setp emco5-userpanel.0.status-disabled FALSE
setp emco5-userpanel.0.status-enabled TRUE
# - create blinking signal and connect to the active signal
setp pwmgen.0.enable TRUE
setp pwmgen.0.value 0.5
setp pwmgen.0.scale 1.0
setp pwmgen.0.pwm-freq 1.0
net status-active emco5-userpanel.0.status-active <= pwmgen.0.pwm
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
Time to create page: 0.064 seconds