Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 12:44:31 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Pause/resume macro for manual axis movement
Pages: 1   Go Down
Print
Author Topic: Pause/resume macro for manual axis movement  (Read 1547 times)
0 Members and 1 Guest are viewing this topic.
Scott
Active Member

Offline Offline

Posts: 139



View Profile
« 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,
Logged

Scott
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« 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
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Scott
Active Member

Offline Offline

Posts: 139



View Profile
« 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.   Huh
Logged

Scott
Scott
Active Member

Offline Offline

Posts: 139



View Profile
« 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.   Huh
Logged

Scott
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« 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
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Scott
Active Member

Offline Offline

Posts: 139



View Profile
« 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,

 
Logged

Scott
Scott
Active Member

Offline Offline

Posts: 139



View Profile
« 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. 
Logged

Scott
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« 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

 
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #8 on: March 07, 2007, 05:37:37 PM »

So did it work?..............
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Scott
Active Member

Offline Offline

Posts: 139



View Profile
« 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.  Wink

Thanks for the help Scott.

Regards,
Logged

Scott
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!