Hello Guest it is September 20, 2019, 08:43:41 AM

Author Topic: NEED AUTO ZERO HELP  (Read 3049 times)

0 Members and 1 Guest are viewing this topic.

NEED AUTO ZERO HELP
« 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

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: NEED AUTO ZERO HELP
« Reply #1 on: June 02, 2012, 11:45:58 AM »
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...
Code: [Select]
  msgbox "Probe already touching"
end if

or whatever. Look under your workbench - probably dropped down the back somewhere.

Ian
Re: NEED AUTO ZERO HELP
« Reply #2 on: June 02, 2012, 04:56:28 PM »
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)

Offline BR549

*
  •  6,895 6,895
    • View Profile
Re: NEED AUTO ZERO HELP
« Reply #3 on: June 02, 2012, 06:27:51 PM »
To the end of your original posting ADD

End IF
End

(;-) TP

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: NEED AUTO ZERO HELP
« Reply #4 on: June 03, 2012, 03:34:59 AM »
In my post I said you were missing something like
Code: [Select]
 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
« Last Edit: June 03, 2012, 03:37:58 AM by stirling »

Offline BR549

*
  •  6,895 6,895
    • View Profile
Re: NEED AUTO ZERO HELP
« Reply #5 on: June 03, 2012, 11:35:48 AM »
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

Re: NEED AUTO ZERO HELP
« Reply #6 on: June 03, 2012, 09:34:39 PM »
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

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: NEED AUTO ZERO HELP
« Reply #7 on: June 03, 2012, 09:41:39 PM »
Hey  Ian  Thanks,works perfect ! I guess I need to work on my cut and paste skills. Thanks , Tommy