Hello Guest it is April 24, 2024, 09:06:11 AM

Author Topic: Macro , Probing, Center of X axis with Distance  (Read 5389 times)

0 Members and 1 Guest are viewing this topic.

vmax549

*
Macro , Probing, Center of X axis with Distance
« on: March 28, 2009, 04:42:23 PM »
Here is a mcaro that probes the center of a spave in the X axis and returns a distance value.  To use position the probe inside of the X axis space then call M1056.

It can be called from a Gcode program, the MDI line or from a button script.

It wil probe the Xaxis space and return to the center point ,then return the distance value.  To be accurate on distance you must have set the Probe tip Diam on the settings page. If the Tdiam is not set the probe will still return to center but the distance value will be off by the amount of the tip diameter.


CODE EXAMPLE:

'M1056 X axis Center With Distance


Code "G91"
Code"G31x10 f5"
While Ismoving()
Wend
Code"#4=#2000"
Code"G1x-.025"
Code"G31x-20 f5"
While ISmoving()
Wend
Code"#5 =#2000"
Code"#6 =[#4-#5]"
code"#8 =[#6/2]"
Code"G1x #8"
While Ismoving()
Wend
Code"G90 M30"
HD= Getvar(6)
 
MsgBox ("X axis Distance is " & HD)