Hello Guest it is November 18, 2019, 09:10:13 PM

Author Topic: Pause/resume macro for manual axis movement  (Read 5787 times)

0 Members and 1 Guest are viewing this topic.

Offline Scott

*
  •  139 139
    • View Profile
Pause/resume macro for manual axis movement
« 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,
Scott

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Pause/resume macro for manual axis movement
« Reply #1 on: March 05, 2007, 09:16:20 PM »
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
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline Scott

*
  •  139 139
    • View Profile
Re: Pause/resume macro for manual axis movement
« Reply #2 on: March 06, 2007, 12:16:33 AM »
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.   ???
Scott

Offline Scott

*
  •  139 139
    • View Profile
Re: Pause/resume macro for manual axis movement
« Reply #3 on: March 06, 2007, 12:49:18 AM »
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.   ???
Scott

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Pause/resume macro for manual axis movement
« Reply #4 on: March 06, 2007, 08:31:05 AM »
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
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline Scott

*
  •  139 139
    • View Profile
Re: Pause/resume macro for manual axis movement
« Reply #5 on: March 06, 2007, 09:46:19 AM »
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,

 
Scott

Offline Scott

*
  •  139 139
    • View Profile
Re: Pause/resume macro for manual axis movement
« Reply #6 on: March 06, 2007, 12:31:24 PM »
The SystemWaitFor (Start) does appear to work.  It didn't on my office/design computer, but does at the machine. 
Scott

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Pause/resume macro for manual axis movement
« Reply #7 on: March 06, 2007, 01:11:54 PM »
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

 
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Pause/resume macro for manual axis movement
« Reply #8 on: March 07, 2007, 05:37:37 PM »
So did it work?..............
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/

Offline Scott

*
  •  139 139
    • View Profile
Re: Pause/resume macro for manual axis movement
« Reply #9 on: March 08, 2007, 12:30:47 AM »
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,
Scott