How to get G31 result in machine coordinates

Post anything you want to discuss with others about the software.

How to get G31 result in machine coordinates

Postby skyler1440 » Fri Feb 25, 2022 2:33 am

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?
skyler1440
 
Posts: 4
Joined: Sat Dec 11, 2021 11:55 pm

Re: How to get G31 result in machine coordinates

Postby DanStory » Fri Feb 25, 2022 3:27 am

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();
DanStory
 
Posts: 22
Joined: Tue Nov 30, 2021 12:29 am

Re: How to get G31 result in machine coordinates

Postby skyler1440 » Sat Feb 26, 2022 11:39 pm

That works great, thanks!
skyler1440
 
Posts: 4
Joined: Sat Dec 11, 2021 11:55 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: Bing [Bot] and 19 guests