Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: wyb_506 on July 06, 2012, 01:21:52 AM

Title: how to get Z position while moving
Post by: wyb_506 on July 06, 2012, 01:21:52 AM
z=0
code "G53 Z60"
while ismoving()
 if active(input4) then --like a prob
  z=GetoemDRO(802)  ---get Z current position( also I try getdro(2))
 end if
Wend
----
I want to get the a Z position while Z is moving, but finally I always get the last stop position  Z=60, why?
thank you!!
Title: Re: how to get Z position while moving
Post by: Graham Waterworth on July 06, 2012, 04:31:11 AM
The G31 command is used to detect the probe touch, Search the forum for G31 and you will find many examples of touch probe code.

Here is just one of many:-

http://www.machsupport.com/forum/index.php/topic,21306.0.html