How to get Data from a Probe
How to Get Data From a probe Cycle
When a Probe Cycle is done (G31) the point that the probe contacts the material is saved in Mach. The DRO's WILL NOT be the correct probe position! The reason the DROs will not be in the correct pos is because the axis can not stop instantly. Once the probe is pressed the axis must decelerate to a stop past the point where the probe hit. The correct probe position is saved as a "Var". The Vars are as follows:
- Var(2000) = X
- Var(2001) = Y
- Var(2002) = Z
To Get the data in VB use GetVar().
As of this writing (April 30, 2007), the current release of Mach 3 does not adjust the value of Var(2002) with the G43 H## tool length. So you will need to do this in your code yourself.
You may decide to copy the probe's length from the tool table into a user parameter, such as #999, and then use Var(999) to adjust the value returned by Var(2002). When Mach 3 is upgraded to account for tool lengths, you can use your old programs, unedited, by setting #999 to zero.
This kind of adjustment will be needed anyway to compensate for the stylus's radius when probing in the X and Y directions. For the greatest accuracy, you may decide to use different radii for +X, +Y, -X, and -Y. Choosing a set of user parameters for these radii that are common in all of your programs will let you avoid distributed program edits when the probe's stylus is replaced.
VB Probe Example:
Code "G31 Z-4.0 F20" While IsMoving() Wend ZProbePos = GetVar(2002)'This will get the data from the probe