- Posts: 310
- Thank you received: 0
Programmatically Modifying the Tool Table
3 years 9 months ago #261840
by JetForMe
Programmatically Modifying the Tool Table was created by JetForMe
Not sure if this is the best topic area for this question.
I'd like to write some code to modify the tool library, to be invoked from the UI or possibly other scripts. Is there a way to do this safely, and have it reload the tool table into the running instance?
I also want to expand my tool changer code to have a "load" feature, where you can add a new tool to the spindle, and it first touches it off then puts it into the designated holder pocket. It's been a while since I wrote the individual code to do this, but I think the tool length is updated by the G10 call, so clearly some programmatic updates to tools work well.
But what if I want to add or remove tools programmatically to the tool table (ignoring what's happening in reality)? The tool table editor is a separate process, and making a change there doesn't automatically reload the tools in Axis/LinuxCNC.
Thanks in advance…
I'd like to write some code to modify the tool library, to be invoked from the UI or possibly other scripts. Is there a way to do this safely, and have it reload the tool table into the running instance?
I also want to expand my tool changer code to have a "load" feature, where you can add a new tool to the spindle, and it first touches it off then puts it into the designated holder pocket. It's been a while since I wrote the individual code to do this, but I think the tool length is updated by the G10 call, so clearly some programmatic updates to tools work well.
But what if I want to add or remove tools programmatically to the tool table (ignoring what's happening in reality)? The tool table editor is a separate process, and making a change there doesn't automatically reload the tools in Axis/LinuxCNC.
Thanks in advance…
Please Log in to join the conversation.
3 years 9 months ago #261935
by andypugh
Replied by andypugh on topic Programmatically Modifying the Tool Table
Your code would need to append the new tools to the tool.tbl file and then force a tool table reload.
If you do it all in Python then it is c.load_tool_table here. linuxcnc.org/docs/stable/html/config/python-interface.html
If you do it all in Python then it is c.load_tool_table here. linuxcnc.org/docs/stable/html/config/python-interface.html
Please Log in to join the conversation.
3 years 9 months ago #261964
by cmorley
Replied by cmorley on topic Programmatically Modifying the Tool Table
Also a way to reload the screen if the tool offsets change.
Which is a little tricky with AXIS.
Which is a little tricky with AXIS.
Please Log in to join the conversation.
3 years 9 months ago #262002
by JetForMe
Replied by JetForMe on topic Programmatically Modifying the Tool Table
I think, at least for the purposes of this proof of concept, that I can do that myself, since tool offset changes should only happen as a result of a tool load or change operation coordinated by my scripts. Well, I don't know about reloading the screen, but I can reload the tool table with Andy’s suggestion.Also a way to reload the screen if the tool offsets change.
Which is a little tricky with AXIS.
Please Log in to join the conversation.
Time to create page: 0.080 seconds
