I'm a little new to Mach3 and though I searched profusely I could not find code that supported the native "Tool Change Location" feature that's in Mach3's "Settings" area.
I just need to do simple manual tool changing without loosing coords and ruining my stock.
Will my code below do the trick?
Thanks in advance!
-Hbaba
':::::::::::::::::::
'::: M6Start.m1s ::: Allows use of Mach3's "Settings"|"Tool Change Information" to
'::::::::::::::::::: assist manual tool changes and return to tool coords to continue machining.
toolChangeX = GetOEMDRO(1200)
toolChangeY = GetOEMDRO(1201)
toolChangeZ = GetOEMDRO(1202)
currX = GetOEMDRO(83)
currY = GetOEMDRO(84)
currZ = GetOEMDRO(85)
currTool = GetOEMDRO(824) 'Tool Information:Tool# in Mach3 from GCode
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
'::: Move up (from stock) then over to Tool Change Location
Code "G0Z" & toolChangeZ
Code "G0X" & toolChangeX & "Y" & toolChangeY
'::: While the machine is in motion lets slow our app down to conserve CPU cycles
While IsMoving()
Sleep(10)
Wend
'::: Stop process, alert operator, provide next tool #, allow operator to continue
MsgBox(" Change current tool to new tool #" & GetOEMDRO(824) & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Click ""OK"" after tool change is complete" & " ")
'::: Move back (to stock) and then down to work coordinance
Code "G0X" & currX & "Y" & currY
Code "G0Z" & currZ
'::: While the machine is in motion lets slow our app down to conserve CPU cycles
While IsMoving()
Sleep(10)
Wend
'::: DEBUG and reference...
'::: Show Tool Change Location>
' MsgBox("Tool Change Location ::: GetOEMDRO(n)" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
' "X n=1200: " & GetOEMDRO(1200) & _
' Chr(13) & Chr(10) & _
' "Y n=1201: " & GetOEMDRO(1201) & _
' Chr(13) & Chr(10) & _
' "Z n=1202: " & GetOEMDRO(1202))
':::Show Current DRO values
' MsgBox("Current DROs {Machine Coords} ::: GetOEMDRO(n)" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
' "X n=83: " & GetOEMDRO(83) & _
' Chr(13) & Chr(10) & _
' "Y n=84: " & GetOEMDRO(84) & _
' Chr(13) & Chr(10) & _
' "Z n=85: " & GetOEMDRO(85) & _
' Chr(13) & Chr(10) & _
' "A n=86: " & GetOEMDRO(86) & _
' Chr(13) & Chr(10) & _
' "B n=87: " & GetOEMDRO(87) & _
' Chr(13) & Chr(10) & _
' "C n=88: " & GetOEMDRO(88))