Hello
I would like to try Mach4 on the Mill.
But I need A.T.Z. to update zero piece with new tool length.
my question :
is it possible to migrate these functions from Mach3 to Mach4?
1 and 2 Red are the scripts
3 Blue color, led probe contact.
4 color Pink, DRO
I attach Mach3 scripts, images and screens.
thank you.
REM A.T.Z. Antonio
If Not GetLed (7) Then ' è referenziato X
vxled = 1
End If
If Not GetLed (8) Then ' è referenziato Y
vyled = 1
End If
If Not GetLed (9) Then ' è referenziato Z
vzled = 1
End If
Tled = vxled + vyled + vzled
If Tled = 3 Then ' se non sono referenziati X, Y e Z esco
If IsSuchSignal (22) Then ' Il Probe è abilitato
DoSpinStop() ' Fermo il Motore
Xpos = GetParam("XMachine") ' Memorizzo XY in Assoluto
Ypos = GetParam("YMachine")
Zpos = GetParam("ZDRO") ' Memorizzo Z in Relativo
Fcurr = GetParam("FeedRate") ' Memorizzo FeedRate corrente
code "G53 G0 Z0"
code "G53 G0 X64.7 Y-19.95" ' Posizione inizio ricerca Assoluta Switch Zero XY
While IsMoving()
Wend
code "G53 Z-1"
While IsMoving()
Wend
tmp = (GetParam("ZDRO")-200 )
code "G31 Z" & tmp & "F180" ' Cerco Switch fino a -200
code "G4 P1"
While IsMoving()
Wend
Call SetDRO( 2,GetUserDRO(2001))
'SetParam("FeedRate",Fcurr)
code "G0 G53 Z0"
While IsMoving()
Wend
MsgBox ("Utensile Azzerato Correttamente")
End If
Else
MsgBox ("Per poter cambiare l'utensile bisognava prima aver referenziato la macchina")
End If
REM A.T.Z. Antonio Probe SET
If Not GetLed (7) Then ' è referenziato X
vxled = 1
End If
If Not GetLed (8) Then ' è referenziato Y
vyled = 1
End If
If Not GetLed (9) Then ' è referenziato Z
vzled = 1
End If
Tled = vxled + vyled + vzled
If Tled = 3 Then ' se non sono referenziati X, Y e Z esco
If IsSuchSignal (22) Then ' Il Probe è abilitato
DoSpinStop() ' Fermo il Motore
code "G53 G0 Z0"
While IsMoving() ' Aspetto mentre si muove
Wend
Xpos = GetParam("XMachine") ' Memorizzo XYZ in Assoluto
Ypos = GetParam("YMachine")
Zpos = GetParam("ZMachine")
Fcurr = GetParam("FeedRate") ' Memorizzo FeedRate corrente
code "G53 G0 Z0"
code "G53 G0 X64.7 Y-19.95" ' Posizione Assoluta inizio ricerca Switch Zero XY
While IsMoving() ' Aspetto mentre si muove
Wend
code "G53 Z-1" ' Posizione Assoluta inizio ricerca Switch Zero Z
While IsMoving() ' Aspetto mentre si muove
Wend
code "G31 Z" & (GetParam("ZDRO")-200) & "F180" ' Cerco Switch fino a -200
code "G4 P1"
While IsMoving() ' Aspetto mentre si muove
Wend
SetUserDRO(2001, GetParam("ZDRO")) ' Trovato il segnale cioè lo switch, sovrascrivo il valore dell'UserDRO
' con quello letto in ZDRO
code "G0 G53 Z" & Zpos ' Alzo prima la Z
While IsMoving() ' Aspetto mentre si muove
Wend
MsgBox ("SET utensile completato corretamente")
End If
Else
MsgBox ("Per poter cambiare l'utensile bisognava prima aver referenziato la macchina")
End If