VB Scripter Window
the leaning curve has been so steep.........................
but i did it and made some adjustments...
here is the script... and runs very well
' probe x surface macro
FeedCurrent = GetOemDRO(818) 'Get the current settings, OEM DROs (818)=Feedrate DRO
XCurrent = GetOemDro(800) 'OEM DROs (800)=X DRO
GageX = -11.5 'Gage Block x 10 plus 1.5
XNew = XCurrent + 300 'probe to the right
YCurrent = GetOemDro(801) 'OEM DROs (801)=Y DRO
GageY = -11.5 'Gage Block Y 10 plus 1.5
Code "G90F200" 'slow feed rate to 200 MM/MIN
SetOemDRO(818,200)
Code "G4 P1" 'Pause 1 second to position probe plate
Code "G31 X" &XNew
While IsMoving()
Sleep(10)
Wend
Call SetDro (0,GageX) 'DRO(0)=x DRO
XFinalMove = GageX -10
Code "G0 X" &XFinalMove
YpreOne = YCurrent-30 ' Y positioning
Code "G0 Y" &YpreOne 'X en posicion para medir Y
Code "G0 X20"
' probe y surface macro
YCurrent = GetOemDro(801) 'OEM DROs (801)=Y DRO
YNew = YCurrent + 300 'probe on y axis
ZCurrent = GetOemDro(802) 'OEM DROs (802)=Z DRO
GageH = GetOEMDRO(1001)
Code "G90F200" 'slow feed rate to 200 MM/MIN
SetOemDRO(818,200)
Code "G4 P1"
Code "G31 Y" &YNew 'Y Zero
While IsMoving()
Sleep(10)
Wend
Call SetDro (1,GageY) 'DRO(1)=y DRO
YFinalMove = GageY -10
Code "G0 Y" &YFinalMove
'Z Position
ZpreOne = ZCurrent +15
Code "G0 Z"&ZpreOne
Code "G0 Y20" 'Y en posicion para medir Z
ZCurrent = GetOemDro(802) 'OEM DROs (802)=Z DRO
Znew = ZCurrent-300
Code "G90F200" 'slow feed rate to 200 MM/MIN
SetOemDRO(818,200)
Code "G4 P1" 'Pause 1 second to give time to position probe plate
Code "G31 Z" &ZNew
While IsMoving()
Sleep(10)
Wend
Call SetDro (2,GageH) 'DRO(2)=Z DRO
FinalMove = GageH + 10
Code "G0 Z" &FinalMove
Code "F" &FeedCurrent 'restore starting feed rate
SetOemDRO(818,FeedCurrent)