Can someone help with modifying the code that I was using with Mach3 paralell port, to use with KFLOP.
It doesnt work with Kflop.
I tested the Touchplate, with the Mach3 probe light.
When I start the script, the Z axis starts to move down, but when I touch the plate it keeps moving down.
"CODE"
Option Explicit 'VBScript To probe In the z axis 'NOTE: This script is for metric as Native Units alterd by hemsworthlad
Dim fastdown
Dim slowdown
Dim searchamount
Dim retractamount
Dim plateoffset
Dim currentfeed
Dim Znew
fastdown = 150
slowdown = 50
searchamount = 100
retractamount = 20
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Else
Code "G4 P1" 'Pause 1 seconds to give time to position probe plate
PlateOffset = GetUserDRO(1151) 'Get plate offset DRO
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F" &fastdown 'slow down feedrate to what ever is set in fastdown var
Rem Probe In the z direction
ZNew = GetDro(2) - searchamount 'probe move to current z - what ever is set in searchamount var
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew +2.5 'move back + 2.5mm to hit point incase there was overshoot +.1
While IsMoving ()
Wend
Rem End add lines
Code "F" &slowdown 'slow down feedrate to what ever is set in slowdown var
ZNew = GetDro(2) - 6 'probe move to current z - 6mm
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
If PlateOffset <> 0 Then
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
ZNew = PlateOffset + retractamount 'calc retract
Code "G0 Z" &ZNew 'put the Z retract height you want here
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
End If
Code "F" &CurrentFeed 'Returns to prior feed rate
End If