Programmatically Modifying the Tool Table
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
14 Jan 2023 00:10 #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 or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23162
- Thank you received: 4860
14 Jan 2023 12:26 #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
The following user(s) said Thank You: JetForMe
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7777
- Thank you received: 2073
14 Jan 2023 18:16 #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 or Create an account to join the conversation.
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
15 Jan 2023 00:56 #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 or Create an account to join the conversation.
Time to create page: 0.054 seconds