512,508 active members
4,486 visitors online
Register for free
IndustryArena Forum > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2) > need help with HAL - toggle settings with one button
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005

    need help with HAL - toggle settings with one button

    I'm having trouble sorting over the lengthy docs can someone please help ?

    I've already got everything setup w/ the steppers and got past the external MPG tutorial, so I can use a jog-dial on an axis, which does work. The example unfortunately wants me to use a MUX encoder to toggle between axis and jog resolutions.

    What I want to do, is assign a push-button to select the MPG jog resolution (.1, .01, and .001) - and another pushbutton to assign the axis (x, y, or z). So, it would default to the first value, and each time I push the button it iterates thru the list looping back to the first.

    Is there an example somewhere or can someone help me figure out how to do this please? Thanks.
    WWW.RAIDGEAR.NET - FFC cables, foam headset replacement parts, and other gadgets.

  2. #2
    Join Date
    Nov 2005
    You could do this using classicladder
    connect your button (through CL) to a counter
    then have outputs that respond to each count of that counter.
    similar idea to this:


    If you know how to program you could also build a custom HAL component.
    see the manual.

  3. #3
    Join Date
    Jul 2005
    I managed to figure out how to toggle the MPG resolution with one button, it took me two days of studying, trial and error:

    # The following is the 4-value select / pushbutton !
    net scale1 toggle.3.in <= pyvcp.jogResB1 
    net scale2 toggle.3.out => pyvcp.mux4Led1 toggle.4.in mux4.0.sel0
    net scale3 toggle.4.out => pyvcp.mux4Led2 mux4.0.sel1
    # sets the jog value for the mpg
    net pend-scale axis.0.jog-scale <= mux4.0.out
    net pend-scale axis.1.jog-scale
    net pend-scale axis.2.jog-scale
    Now the next / last one I am stuck on is a single-button selector for axis-enable. Yes, I could make a HAL component, I was actually starting to study that section as well. Looks like either / or option is a good deal of time invested - I'm just a few more projects away from completing this machine.
    WWW.RAIDGEAR.NET - FFC cables, foam headset replacement parts, and other gadgets.

Similar Threads

  1. DIY Toggle Clamp Holddowns
    By Regnar in forum DIY CNC Router Table Machines
    Replies: 10
    Last Post: 12-20-2017, 04:20 PM
  2. Jog Mode Toggle
    By dynamotive in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 09-30-2009, 03:04 AM
  3. Robotool CVM1 toggle switches
    By fred.rowe in forum Want To Buy...Need help!
    Replies: 0
    Last Post: 07-25-2009, 05:05 PM
  4. Q: Mach3 Wiring / Toggle Switch
    By Deviant in forum Gecko Drives
    Replies: 3
    Last Post: 02-11-2009, 04:21 AM
  5. Can bad forward/reverse toggle cause motor not to spin?
    By ZipSnipe in forum General CNC Machine Related Electronics
    Replies: 16
    Last Post: 06-03-2006, 02:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts