Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: TOMMYD on June 02, 2012, 09:49:17 AM
-
Hey, My auto zero use to work and now it doesn't . Below is the script I am uesing. The changes I have made are; I went from USB SS to ESS ,Windows xp to Windows 7, And upgraded to the latest ver. of Mach3. The status bar message reads " Scripter Compile Error.in: " .I'm probably missing something simple. Thanks,Tommy
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = .375 'You could put your z-plate thickness here instead
ProbeFeed = 5 'You could put a probing feedrate here instead.
Code "G90 F" &ProbeFeed
If GetOemLed (825)=0 Then
Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z2.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
-
I'm probably missing something simple.
What you're missing Tommy is the "else" clause at the end of your script. It'll say something like...
msgbox "Probe already touching"
end if
or whatever. Look under your workbench - probably dropped down the back somewhere.
Ian
-
Hey Ian, Thanks for the quick responce but that didn't do it.I still get the same error message. this is what the code looks like now.
obviously I don't know how to write code but I can copy and paste,maybe I just ran out of glue
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = .375 'You could put your z-plate thickness here instead
ProbeFeed = 5 'You could put a probing feedrate here instead.
Code "G90 F" &ProbeFeed
If GetOemLed (825)=0 Then
Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z2.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
MsgBox "Probe already touching"
End If)
-
To the end of your original posting ADD
End IF
End
(;-) TP
-
In my post I said you were missing something like
msgbox "Probe already touching"
end if
but for some reason you've added a bracket after the end if - lose it please.
(There's no need for an End at the end of a script)
Ian
-
HIYA IAN, I always thought it was good form to use the "END" statement for several reasons.
"End closes any files opened with an Open statement and clears all the application's variables. "
YES, NO ?????
(;-) TP
-
the last line has a typo:
End If)
remove the ) then it will compile (at least it does for me on mach 3.43.62)
Dave
-
Hey Ian Thanks,works perfect ! I guess I need to work on my cut and paste skills. Thanks , Tommy