Hello Guest it is November 15, 2019, 05:58:41 PM

Author Topic: Need help with manual toolchange macro  (Read 35278 times)

0 Members and 1 Guest are viewing this topic.

Re: Need help with manual toolchange macro
« Reply #10 on: December 27, 2012, 08:49:12 AM »
so what command do I have to invoke in order to get Mach to continue with a program from where it left off after I hit cycle start.

What I want is for a input when activated in the middle of a program to stop everything home all the axis and when cycle start pressed, to continue with teh program where everything left off.  Should I just tie that input with the M6 macro? 

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Need help with manual toolchange macro
« Reply #11 on: December 27, 2012, 08:58:56 AM »
I don't know if there's any way to do what you want, other than doing a feedhold, then stop, then restart using Run From Here.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
toolchange macro 6 axis
« Reply #12 on: November 08, 2017, 10:03:51 PM »
 'run up on this a while back, file name M6Start.m1s , if you use 6 axis or not
 'ToolChange Macro For Bed type tool changer 11/05 Brian
Sub Main()
OldTool = GetOEMDRO (1200)           'Tool In spindle DRO, You must add this to each of your screen sets
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 17                       'Max number of tools it will change, it will take upto 254 or so(not sure)
ToolDown   = -3.0                          'Z Pos to Get or drop a tool
ToolUp     = -10.0                    'Z Hieght to Rapid from tool to tool, you change this location
If NewTool = OldTool Then
   Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)  'this won't ask if tool number is in your tooltable
Wend
Code "G00 G53 Z" & ToolUp
While IsMoving()
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
ActivateSignal(Output1)                           'Turn On Draw bar to release the tool
Code "G4 P1.0"                                    'Wait for the tool to release
'SystemWaitFor (7)                                'Wait for the tool Release Limit switch
Code "G53 Z-2.5" & ToolUp
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output1)                             'Turn Off Draw bar to Clamp the tool
Code "G4 P1.0"                                        'Wait for the tool to Clamp
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Code "G00 X" & x & " Y" & y                           'Move back to where the tool change was prompted
End Sub

Sub MovePos(ByVal ToolNumber As Integer)

Select Case ToolNumber
       Case Is = 0
       ActivateSignal(Output1)                           'Turn On Draw bar to release the tool
        ZPos = .50
       Case Is = 1
         Xpos = -15.00                      'this is where tool 1  is, change to fit your stuff
         YPos = .50
       Case Is = 2
         Xpos = -13.00
         YPos = .50                         'this is where tool 2  is, change to fit your stuff
       Case Is = 3
         Xpos = -11.00
         YPos = .50                            'you see how it works, add to this list
       Case Is = 4
         Xpos = -9.00
         YPos = .50
       Case Is = 5
         Xpos = -7.00
         YPos = .50
       Case Is = 6
         Xpos = -5.00
         YPos = .50
       Case Is = 7
         Xpos = -3.00
         YPos = .50
       Case Is = 8
         Xpos = -1.00
         YPos = .50
       Case Is = 9
         Xpos = 1.00
         YPos = .50
       Case Is = 10
         Xpos = 3.00
         YPos = .50
       Case Is = 11
         Xpos = 5.00
         YPos = .50
       Case Is = 12
         Xpos = 7.00
         YPos = .50
       Case Is = 13
         Xpos = 9.00
         YPos = .50
       Case Is = 14
         Xpos = 11.00
         YPos = .50
       Case Is = 15
         Xpos = 13.00
         YPos = .50
       Case Is = 16
         Xpos = 15.00
         YPos = .50
End Select

Code "G53 X" & XPos & " Y" & YPos
End Sub
Main   

« Last Edit: November 08, 2017, 10:05:57 PM by h_key »