How do I get the current tool length in tool_probe_m6 in stdglue.py?

More
2 years 10 months ago #289350 by JohnnyCNC
I am working on a pure Python M6 remap.  I have it, sort-of working.   I need the length of the current tool so I can decide if I need to measure the tool or not.  If the length greater than zero, then I use that Z offset.  Otherwise, I measure the tool to get the Z offset.  My starting point for this project was the tool_probe_m6 routine in stdglue.py.

Thanks
John

Please Log in to join the conversation.

More
2 years 9 months ago #290227 by andypugh

Please Log in to join the conversation.

More
2 years 9 months ago #290228 by andypugh
Actually, inside a remap it is probably better to use the emccanon interface. (This i available in remaps, but not in HAL components)

emccanon.GET_EXTERNAL_TOOL_LENGTH_ZOFFSET might be what you a

github.com/LinuxCNC/linuxcnc/blob/master...74ngc/canonmodule.cc

(Lots of useful things there, including axis motion)

Please Log in to join the conversation.

More
2 years 9 months ago #290243 by JohnnyCNC
This worked but I am up for a better way.

s = linuxcnc.stat()
s.poll()
if s.tool_table[0].zoffset > 0:

Please Log in to join the conversation.

More
2 years 9 months ago #290244 by JohnnyCNC

Actually, inside a remap it is probably better to use the emccanon interface. (This i available in remaps, but not in HAL components)

emccanon.GET_EXTERNAL_TOOL_LENGTH_ZOFFSET might be what you a

github.com/LinuxCNC/linuxcnc/blob/master...74ngc/canonmodule.cc

(Lots of useful things there, including axis motion)
I tried emccanon and it was giving me values that didn't make sense.  Now that I have a little better handle on what I am doing I'll give it another try.
Thanks

 

Please Log in to join the conversation.

Time to create page: 0.193 seconds
Powered by Kunena Forum