Hi guys,
I'm using a tool change macro that, when called, goes to X0 Y0. It pauses there for 5 seconds, and then starts lowering the Z slowly while looking for an input from a touch-off. Once it reads a touch-off, it zeros the Z axis and raises it to .3, then returns to the position it was at when the tool change was called.The problem is that once it gets to X0 Y0, I'd like it to wait for me to manually switch out the tool and hit Cycle Start to go to the tool zeroing portion of the macro. I have tried entering Code "M1", but that has no effect. The macro appears below. I would like to add the command to wait for input from me in the area where I've posted the comment in all caps (before the Tool Zero Macro). Can anyone tell me what I'm doing wrong here?
'ToolChange Macro
Sub Main()
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
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
MaxToolNum = 40 'Max number of tools for the changer
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z0.0" 'Absolute positioning (machine coords) to Z home
While IsMoving()
Wend
Code "G00 G53 X0.00 Y0.00" 'G53 added to this line to select absolute positioning for X and Y too by Ian
While IsMoving()
Wend
Code "G4 P5.0" 'Pause for actual tool change out
'HOW CAN I ADD A COMMAND HERE TO WAIT UNTIL THE CYCLE START BUTTON IS PUSHED BEFORE PROCEEDING?
While IsMoving()
Wend
'Begin tool zero macro here
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2.0" ' this delay gives me time to get from computer to hold probe in place
Code "G40" 'Ian is testing this
Code "G31Z-2 F5" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z.3" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If
'End of tool length macro here
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
End Sub
Main
'Soft limits will trip if turned on and the probe move is not allowed to move below -.3 (in machine coords). This will mess up process, since the retract in Tool Zero Macro retracts .3 inches.