[Home]Jogging With Buttons On A Pendant

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

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>
            </button>    
            <button>
                <halpin>"stop-button"</halpin>
                <text>" Stop"</text> 
                <font>('Fixed',16)</font>
            </button>    
        </hbox>
    </labelframe>
    <labelframe text="Jogging Speed">
        <radiobutton>
            <choices>["Slow","Fast"]</choices> 
            <halpin>"jog-speed"</halpin> 
        </radiobutton>
    </labelframe>
    <labelframe text="Jog X Axis">
        <hbox>
            <button>
                <halpin>"jog-x-minus"</halpin>
                <text>"Left "</text> 
                <font>('Fixed',16)</font>
            </button>    
            <button>
                <halpin>"jog-x-plus"</halpin>
                <text>"Right"</text> 
                <font>('Fixed',16)</font>
            </button>    
        </hbox>
    </labelframe>
    <labelframe text="Jog Y Axis">
        <hbox>
            <button>
                <halpin>"jog-y-minus"</halpin>
                <text>" Out "</text> 
                <font>('Fixed',16)</font>
            </button>    
            <button>
                <halpin>"jog-y-plus"</halpin>
                <text>" In  "</text> 
                <font>('Fixed',16)</font>
            </button>    
        </hbox>
    </labelframe>
    <labelframe text="Jog Z Axis">
        <hbox>
            <button>
                <halpin>"jog-z-minus"</halpin>
                <text>" Down"</text> 
                <font>('Fixed',16)</font>
            </button>    
            <button>
                <halpin>"jog-z-plus"</halpin>
                <text>" Up  "</text> 
                <font>('Fixed',16)</font>
            </button>    
        </hbox>
    </labelframe>

The pyVCP panel

upload:remotegui.png

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


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited March 30, 2008 8:10 am by BigJohnT (diff)
Search:
Published under a Creative Commons License