Good day,
I am in the Process of creating a macro to set my tool change position; First the information
Tool Setter Machine Coordinate X-290 Y101 Z-10
The tool height setter sits 2.99mm above the machine bed at the above X-Y coordinates.
What I want the machine to do when M06 is called is to retract to G53 G0 Z0
Then Rapid to G53 G0 X-290 Y101
Then once at the above G53 Z-10
The problem I am having is the machine tries to do some of these movements together I am not able to figure out exactly why.
M6Start;
"
DoSpinStop() ' Make sure the spindle is OFF
Code"M09" ' Make sure the coolant is OFF
OldTool = GetOEMDRO (1224) 'Tool In spindle DRO You must add this to your settings screen
'x = GetToolChangeStart( 0 ) ' Get x tool change start position
'y = GetToolChangeStart( 1 ) ' Get y tool change start position
'z = GetToolChangeStart( 2 ) ' Get z tool change start position
tool = GetSelectedTool() ' tool to be changed to
NewTool = tool
If NewTool = OldTool Then
Exit Sub
End If
Code "G53 G0 Z0" 'Move Z to 0 In machine Coordinate
Code "G53 G0 X-290 Y101" 'Move to Tool Setter in Machine Coordinate
Code "G53 G0 Z-11" 'Move Z to -10 For Tool Change Position
Call SetUserDRO (1224,NewTool)
SetCurrentTool( NewTool ) ' input new tool into tool in spindle dro
Code "G43 H" & tool ' Call tool offsets for new tool
' Verify Tool Change Complete message box
Dim Msg, Style, Title, Help, Ctxt, Response,MyString
Msg = "Please Insert Tool : " & " ( " & GetSelectedTool( ) & " ) " & " " & GetToolDesc(NewTool)
'Msg = "Please Insert Tool Number " & " ( " & GetSelectedTool() & " ) " & " " & GetToolDesc(Tool) ' Define message
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons
Style = 0 + 48 + 0 ' Define buttons.
Title = "Tool Change Requested" ' Define title
Help = "DEMO.HLP" ' Define Help file
Ctxt = 1000 ' Define topic
'context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbOk Then ' User chose Ok
MyString = "Ok" ' Perform some action
End If
'Show user the current tool description
Message "Tool # " & GetCurrentTool() & " : " & GetToolDesc(GetCurrentTool) & " Installed " & " Returning to Tool Change Start Position"
Code "G00 Z15"
'Code "G00 X" & x & "Y" & y & "Z" & z 'Move back to where the tool change was prompted
While IsMoving
Wend
End
"
I am pretty sure the problem lies in the bold above, but can not figure out the best way to get my desire result.
Then after Cycle start This returns the machine to the work coordinates before the tool change.
M6End;
"
'REM The default script here moves the tool back To m6start If Any movement has occured during the tool change..
'x = GetToolChangeStart( 0 )
'y = GetToolChangeStart( 1 )
'z = GetToolChangeStart( 2 )
'a = GetToolChangeStart( 3 )
'b = GetToolChangeStart( 4 )
'c = GetToolChangeStart( 5 )
'If(IsSafeZ() = 1) Then
' SafeZ = GetSafeZ()
' If SafeZ > z Then StraightTraverse x, y,SafeZ, a, b, c
' StraightFeed x, y, z , a, b, c
'Else
'Code"G00 X" & x & "Y" & y
'end if
"
Appreciate your help here.