ked ze som to tu nenasiel tak to sem dam
ku kazdemu scriptu je samozrejme potrebna sonda (probe) pripojena zvicajne na pin 15 v nastaveniach Config /ports and pins/input signals
Script 1
tento sa do machu vklada cez Operator/Edit button scrip/Auto Tool Zero (tlacitko)
tento script berie hrubku kontaktnej plochy z DRO ale ked ze sa este v machu moc neviznam tak neviem popisat co a ako
ale script funguje
Kód: Vybrat vše
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 P5" ' this delay gives me time to get from computer to hold probe in place
Code "G31Z-40 F500" '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 axact 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 Z25.4" '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
Tento script ma na zaciatku "PlateThickness = 10" kde sa nastavuje hrubka kontaktnej plochy (plosak alebo kus kovu)
Kód: Vybrat vše
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = 10
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 "G91 G4 P2" ' two second delay
Code "G31 Z-10.0 F100" 'Z goes down a max of 1.0 at 5IPM
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G90 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 "G90 G0 Z25.0" 'retract Z to 1.0 inch
Code "(Z axis is now zeroed test)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If
pohybuje sa 75 mm do kazdej strany od 0 cize x75 x-75 y75 y-75
Kód: Vybrat vše
Rem VBScript To center probe inside a pipe
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Probe plate is grounded, check connection and try again)"
Else
FeedCurrent = GetOemDRO(818) 'Get the current settings
XCurrent = GetDro(0)
YCurrent = GetDro(1)
Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "F100" 'feed rate 100 mm/min
Rem Probe Left
XNew = Xcurrent - 75 'probe 75 mm to left
Code "G31 X" &XNew
While IsMoving() 'wait for the move to finish
Wend
XPos1 = GetVar(2000) 'get the probe touch location
Code "G0 X" &XCurrent 'rapid move back to start point
Rem Probe Right
XNew = XCurrent + 75 'probe 75 mm to right
Code "G31 X" &XNew
While IsMoving()
Wend
XPos2 = GetVar(2000)
XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
Code "G0 X" &XCenter 'rapid move to the x center location
Rem Probe up
YNew = YCurrent + 75
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos1 = GetVar(2001)
Code "G0 Y" &YCurrent
Rem Probe down
YNew = YCurrent - 75
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos2 = GetVar(2001)
YCenter = (YPos1 + YPos2) / 2
Rem move To the center
Code "G0 Y" &YCenter
While IsMoving ()
Wend
Code "F" &FeedCurrent 'restore starting feed rate
End If
Rem VBScript To center probe inside a pipe
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Probe plate is grounded, check connection and try again)"
Else
FeedCurrent = GetOemDRO(818) 'Get the current settings
XCurrent = GetDro(0)
YCurrent = GetDro(1)
Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "F100" 'feed rate to 100 mm/min
Rem Probe Left
XNew = Xcurrent - 75 'probe 75 mm to left
Code "G31 X" &XNew
While IsMoving() 'wait for the move to finish
Wend
XPos1 = GetVar(2000) 'get the probe touch location
Code "G0 X" &XCurrent 'rapid move back to start point
Rem Probe Right
XNew = XCurrent + 75 'probe 75 mm to right
Code "G31 X" &XNew
While IsMoving()
Wend
XPos2 = GetVar(2000)
XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
Code "G0 X" &XCenter 'rapid move to the x center location
Rem Probe up
YNew = YCurrent + 75
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos1 = GetVar(2001)
Code "G0 Y" &YCurrent
Rem Probe down
YNew = YCurrent - 75
Code "G31 Y" &YNew
While IsMoving()
Wend
YPos2 = GetVar(2001)
YCenter = (YPos1 + YPos2) / 2
Rem move To the center
Code "G0 Y" &YCenter
While IsMoving ()
Wend
Code "F" &FeedCurrent 'restore starting feed rate
End If