Hi Gary:
Thx, good to know. A script shouldn't take any time at all if it uses a line like
Block("MotionPin19");
that stops the script altogether until Auggie sees pin19 toggle, at which point the
script will continue onwards..
The script command
a = GlobalGet("ProbeHit");
will make "a" true if the probe hit on the last G31.
x = GobalGet("ProbePos0") will return the X position of the hit. 1,2,3 will give you y,z,a axis positions
where the probe hit and before decelerating.
If your just doing a zeroing to a touch plate you may want a script something like this one
designed to be called from a zeroed Z axis position somewhere less than 1" above the touchplate.
User is expected to zero axis when it stops. Because it rises off plate at such a slow feedrate
you will stop withing a step or so of probe hit. If you make the feedrate of rise F1, youd probably
stop exactly on the zero point.
global function ZeroToPlate()
{
GlobalSet("ProbeInvert",0); //set probe to normal state
Engine.GCode("G31Z-25F100"); //probe 25mm down in Z
Block("MotionStill"); //wait for all motion to stop, no system delay for this.
if( !GlobalGet("ProbeHit"))
{ print"No hit on probe ..Try again closer to plate.");
return;
} //we didnt hit the probe during the move
GlobalSet("ProbeInvert",1); //invert probe switch
Engine.GCode("G31Z0F10"); //probe upwards slowly till switch releases
Block("MotionStill"); //wait for all motion to stop, no system delay for this.
if( GlobalGet("ProbeHit"))
{
print("Zero Axis, probe complete.");
GlobalSet("Zero3",1); //this will zero axis #3-Z (the numbering starts at 1 for X in zeroing
//function even though some other functions start with 0 for X
}
else { print(" Error in touchoff" ); };
}
Thats off top of head, untested so you may find lots of syntax errors there..

Art