Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Scott on March 05, 2007, 07:48:15 PM
-
Is it possible to pause a macro and manually move a axis (Z for example) and then resume execution of the macro?
Thanks,
-
Sure,
Put an If-Then conditional statement, that if a User LED turns on then a M01 is issued, then resume macro after your move.
If GetUserLED(1200) Then 'Some Macro Pause button turns on this LED, push again turns off LED
Code "M01" 'Pauses running code, and turns on LED (65 optional stop m1 led)
End If
'Move your Z axis
If NOT(GetUserLED(1200)) and GetLED(65) Then 'when you hit the Pause macro button, it makes this statment true.
DoButton(1000) 'Cycle start button is "pressed" and code resumes.
End If
'Macro can resume here or exit.
Scott
-
Thanks Scott,
I'm away from the machine at the moment, but I'll give that a try.
Just for fun, I tried issuing a "M01" in a macro to see if I could then 'Cycle Start' to resume and it doesn't stop, it just keeps executing the macro. ???
-
A SystemWaitFor (Start) will pause the execution of the macro, but I can't jog an axis then.
It states that "This allows interfacing with physical controls on the machine". That must not mean Mach3 controls. ???
-
Perhaps I don't fully understand what you want.
Repost more details and I'll try to help you get what you want.
(Details to include step by step of what you want, and what you expect to happen)
Scott
-
Basically, I'm reworking a 'tool measure/change' macro for another guy and before it does the long slow G31 plunges, I'd like to pause the macro at a certain point, allow them to quickly jog the Z axis down into position manually, then return control to the macro.
If actual G-code was generated (as with Open/Close/Load teach file), then the M01 or M0 would work, but I'm just having it execute with a button push at the moment (like the Ref All and other buttons).
Thanks,
-
The SystemWaitFor (Start) does appear to work. It didn't on my office/design computer, but does at the machine.
-
Well I have it working here:
'Tool Probe Pause M31 macro
Code "G0 Xx Yy Zz" 'Probe start location
SystemWaitFor (Start) 'When the running part hits M31 it pauses, you can then jog the Z down to where ever
Code "G31 Z-3" 'This is your standard Probe cycle it will stop at the maximum Z down from where ever you have joged from.
While IsMoving
Wend
Scott
-
So did it work?..............
-
Yes it did. I think I have the tool measure/change macro working. I'll let the guy test it out to see if there's any problem on his machine. It worked on mine, but I don't have the same kind of switch. I just used a contact plate to test it.
The macro is basically the same as the one that Fabiano was working on in another thread, but I added a few things to it and the screen. One thing that I'm not sure on is where Fabiano was having some switch contact error from one time to the next. I added a switch error DRO that can be used just in case there is a consistent error, but I'm not sure that I have the value of it calculated right and in the right place in the macro. I'm not the worlds best mathematician. ;)
Thanks for the help Scott.
Regards,