Hello Guest it is March 29, 2024, 04:03:42 AM

Author Topic: Macro Pump and Spindle commands  (Read 4274 times)

0 Members and 1 Guest are viewing this topic.

Macro Pump and Spindle commands
« on: October 17, 2013, 12:43:12 AM »
Trying to setup a convenient group of buttons wired to a second BOB. Things like Safe Z, Flood on/off, Pulley selection etc. I have them all "working" but its just not perfect. I am using a momentary button for each input. The Macro Pump code for each input is along these lines:

Flood=GetOEMLED (823)

REM Flood control on/off
If Flood=True Then
Code DoOEMButton(113)
End If

So this works but I seem to have to hit the sweet spot for when the macro runs. Hold the button too long, and the flood comes on, then back off (sometimes all I see is the Output LED flash on diag screen).
The worst part is I have a Spindle CW and a Spindle CCW button. If I am not perfect in pressing my button for just the right amount of time, my spindle will not cycle on. If and when I cycle with the on screen buttons or a button I made myself with the "Code DoOEMButton(110)" it starts perfectly every time. So it must be something to do with my Macro Pump setup.

Thanks,
Bryan

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Macro Pump and Spindle commands
« Reply #1 on: October 17, 2013, 02:57:34 AM »
Better using OEM Triggers I would say.
Hood

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro Pump and Spindle commands
« Reply #2 on: October 17, 2013, 11:40:51 AM »
Looks as if you are using the "toggle" on/off buttons in your flood example, not a good idea without a lot of safety code to go with it.  Also the toggle ed functions are best used with a supporting LED so that you KNOW what state it is in.

Also after each function call you need a While Ismoving(), Wend statement to insure MAch3 waits  for the completion of the call and does not just jump over the call and not do it.

Just a thought, (;-) TP
Re: Macro Pump and Spindle commands
« Reply #3 on: October 17, 2013, 11:51:50 AM »
I did use oemtrigger for CW,CCW and flood. Works much better.

out of curiosity, what type of safety code would you put in for a simple "dobutton" command such as flood on/off?

good thoughts on while,wend. I will look at my macropump code and make sure I implement it for the remaining code.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Macro Pump and Spindle commands
« Reply #4 on: October 17, 2013, 11:55:09 AM »
In the macropump you would check the state of the function as compared to what you want. IF it is already in that state then bypass the function else change the function.

In the  case of the flood turning on IF the led is already on then ignore the request. IF the led if off then do the request. This keeps the CPU useage of the macropump to a minimum.

(;-) TP
Re: Macro Pump and Spindle commands
« Reply #5 on: October 17, 2013, 11:59:31 AM »
I see, but I am using it as an on/off button. Thus if I push the button, I want it to change its current state regardless. An example of how I am using this particular button is, when setting up stock and or a tool, I turn on my flood to make sure I am getting the coverage desired. Turn it off and let the program handle it from there. All with only one button to cycle the pump.
Re: Macro Pump and Spindle commands
« Reply #6 on: October 17, 2013, 12:03:31 PM »
In the original code example, I had my flood button programmed to input#3. My code called up the LED to determine if the button is being pushed. If it had been pushed then it would trigger the flood toggle OEM button. Kind of the long way around considering how easy OEM triggers are to setup now that I know how to do it.