Page 1 of 1

How to get G31 result in machine coordinates

PostPosted: Fri Feb 25, 2022 2:33 am
by skyler1440
For making my own tool probing macro, I would like to be able to get the result of a G31 probing command in machine coordinates. However it seems that by default the results are in the active coordinate system (such as G54)? Is there a way to do this, or would I need to use a work around?

Re: How to get G31 result in machine coordinates

PostPosted: Fri Feb 25, 2022 3:27 am
by DanStory
I end up doing
Code: Select all
// get probe Z result
var offsetProbeZ = exec.Getvar(5063);
// add current work offset to get probe in machine pos
offsetProbeZ += exec.GetZmachpos() - exec.GetZpos();

Re: How to get G31 result in machine coordinates

PostPosted: Sat Feb 26, 2022 11:39 pm
by skyler1440
That works great, thanks!