Hello Guest it is February 27, 2021, 02:51:06 AM

Author Topic: Needing Auto Tool Zero script  (Read 256 times)

0 Members and 1 Guest are viewing this topic.

Needing Auto Tool Zero script
« on: May 20, 2020, 09:34:15 PM »
Having trouble Editing the Auto Tool Zero button.  Getting a Compile and Syntax error code.  Anyone out there have a clean script they would like to share?

Offline reuelt

*
  •  487 487
    • View Profile
Re: Needing Auto Tool Zero script
« Reply #1 on: June 23, 2020, 07:27:06 AM »
Try this:

'Probe z surface macro 

FeedCurrent = GetOemDRO(818) 'Get the current settings, OEM DROs (818)=Feedrate DRO
ZCurrent = GetOemDro(802) 'OEM DROs (802)=Z DRO
GageH = GetOEMDRO(1001) 'OEMDRO(1001)=Gage Block Height
ZNew = ZCurrent - 6 'probe down max. 6 inches
Code "G90F5" 'slow feed rate to 5inches/MIN
SetOemDRO(818,5)
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 + 1 ‘move 1 inch above gage height
Code "G0 Z" &FinalMove
Code "F" &FeedCurrent 'restore starting feed rate
SetOemDRO(818,FeedCurrent)
"the gift of God is eternal life through Jesus Christ our Lord"