Jogging_With_Buttons_On_A_Pendant - rmu75/linuxcnc-wiki GitHub Wiki


date: '2008-03-30T17:10:22' title: Jogging With Buttons On A Pendant

This page describes how to jog your machine using buttons on a pendant with halui.

The first part shows how to test your setup using pyVCP to represent your pendant buttons.

In your .ini file in the [HAL] section add:

 HALUI = halui

In your postgui.hal file or custom_postgui.hal file if you ran stepconf add the following:

 # needed for the speed select
 loadrt mux2 count=1
 addf mux2.0 servo-thread

 # set up the remote pendant start and stop buttons
 net remote-start halui.program.run halui.mode.auto <= pyvcp.start-button
 net remote-stop halui.program.stop <= pyvcp.stop-button

 # set the jog speed
 setp mux2.0.in0 25
 setp mux2.0.in1 100
 net remote-speed-select mux2.0.sel <= pyvcp.jog-speed.Fast
 net remote-jog-speed halui.jog-speed <= mux2.0.out

 # the jogging from the buttons
 net remote-jog-x-plus halui.jog.0.plus <= pyvcp.jog-x-plus
 net remote-jog-x-minus halui.jog.0.minus <= pyvcp.jog-x-minus

 net remote-jog-y-plus halui.jog.1.plus <= pyvcp.jog-y-plus
 net remote-jog-y-minus halui.jog.1.minus <= pyvcp.jog-y-minus

 net remote-jog-z-plus halui.jog.2.plus <= pyvcp.jog-z-plus
 net remote-jog-z-minus halui.jog.2.minus <= pyvcp.jog-z-minus

Next for the pyVCP example you need to add to your panel.xml file

    <labelframe text="Run G-Code File">
        <hbox>
            <button>
                <halpin>"start-button"</halpin>
                <text>"Start"</text> 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
            &lt;button&gt;
                &lt;halpin&gt;"stop-button"&lt;/halpin&gt;
                &lt;text&gt;" Stop"&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
        &lt;/hbox&gt;
    &lt;/labelframe&gt;
    &lt;labelframe text="Jogging Speed"&gt;
        &lt;radiobutton&gt;
            &lt;choices&gt;["Slow","Fast"]&lt;/choices&gt; 
            &lt;halpin&gt;"jog-speed"&lt;/halpin&gt; 
        &lt;/radiobutton&gt;
    &lt;/labelframe&gt;
    &lt;labelframe text="Jog X Axis"&gt;
        &lt;hbox&gt;
            &lt;button&gt;
                &lt;halpin&gt;"jog-x-minus"&lt;/halpin&gt;
                &lt;text&gt;"Left "&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
            &lt;button&gt;
                &lt;halpin&gt;"jog-x-plus"&lt;/halpin&gt;
                &lt;text&gt;"Right"&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
        &lt;/hbox&gt;
    &lt;/labelframe&gt;
    &lt;labelframe text="Jog Y Axis"&gt;
        &lt;hbox&gt;
            &lt;button&gt;
                &lt;halpin&gt;"jog-y-minus"&lt;/halpin&gt;
                &lt;text&gt;" Out "&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
            &lt;button&gt;
                &lt;halpin&gt;"jog-y-plus"&lt;/halpin&gt;
                &lt;text&gt;" In  "&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
        &lt;/hbox&gt;
    &lt;/labelframe&gt;
    &lt;labelframe text="Jog Z Axis"&gt;
        &lt;hbox&gt;
            &lt;button&gt;
                &lt;halpin&gt;"jog-z-minus"&lt;/halpin&gt;
                &lt;text&gt;" Down"&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
            &lt;button&gt;
                &lt;halpin&gt;"jog-z-plus"&lt;/halpin&gt;
                &lt;text&gt;" Up  "&lt;/text&gt; 
                <font>('Fixed',16)</font>
            &lt;/button&gt;    
        &lt;/hbox&gt;
    &lt;/labelframe&gt;

The pyVCP panel

upload:remotegui.png

The code for the Rapid to Home button is here Adding Custom MDI buttons

⚠️ **GitHub.com Fallback** ⚠️