Hello Guest it is September 22, 2020, 04:19:22 AM

Author Topic: hard switches not working when program running in mach3  (Read 114 times)

0 Members and 1 Guest are viewing this topic.

hard switches not working when program running in mach3
« on: May 08, 2020, 04:20:41 PM »
Hi
I am running a new mill conversion with mach3 r3.043.062 and have added 5 hardwired switches via a BOB and ethernet smoothstepper. for some bizarre reason they only work when a program is stopped. if the program is running or in feed hold then they dont work.
 the buttons are cycle start, feed hold, spindle on/off and speed up/down. i have configured them to oem trig inputs and have hotkeys pointing to codes 1000, 1001 etc and they work fine. i can push cycle start but then feed hold and the rest dont respond until i stop the program, using the mouse, on feed hold and then stop. far from ideal!
I do have a valid license in my name.
I have tried uninstalling everything including all plugins and PP driver and deleted mach3 folder before a fresh install and bare minimum setup to test the switches.
I'm sure I have used this setup on other machines and don't recall a bug in this version of mach3. my lathe uses a pokeys board for switches but i added a switch as above and that doesnt work there either! so i'm begining to doubt if I'm missing something obvious
thanks in advance

Offline Graham Waterworth

*
  • *
  •  2,158 2,158
  • Yorkshire Dales, England
    • View Profile
Re: hard switches not working when program running in mach3
« Reply #1 on: May 08, 2020, 06:14:49 PM »
I think you will have to program them into the macropump macro and turn it on in config.

Check the inputs required and if active command a dobutton(n) for the corresponding action.
 
Without engineers the world stops
Re: hard switches not working when program running in mach3
« Reply #2 on: May 08, 2020, 08:51:09 PM »
Hi,
when a Gcode program is running or when in <FeedHold> the motion controller is under the direction of Machs
trajectory planner whereas the buttons are part of Machs GUI, which is suspended.

In order for a button to be recognised is for the button or input to be 'polled' on a regular basis, aka the MacroPump
as Graham has suggested. Every 100ms or so the code in the macro pump is run and it will specifically check all of
the inputs in sequence and act on any it finds active.

Another alternative that achieves the same result is to use a Brain. It to is a bunch of code that runs on a regular basis
and can cause specific machine behaviour in response to an input.

Craig
My wife left with my best friend...
     and I miss him!
Re: hard switches not working when program running in mach3
« Reply #3 on: May 09, 2020, 05:26:58 AM »
Thanks that sounds logical as I'm sure in past machines without smooth stepper it was ok. It is interesting that on my lathe with a ethernet smooth stepper all my inputs go into a pokeys board and they work fine at all times.
I have used macropumps so will give that a go. Thanks for the help