Getting notified of tool parameter changes?

  • JetForMe
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
31 Jan 2023 11:19 #263336 by JetForMe
Is there any way for my Python VCP to be notified if a tool is changed, say the tool offset is measured automatically by a toolsetter? I know one option would be to implement the tool database interface, but I think that would have to be a separate executable that then communicates with my VCP through some other means. I suppose I could watch the tool table file, but is there a better way?

Please Log in or Create an account to join the conversation.

More
31 Jan 2023 11:53 #263343 by rodw
People will know better than me but i think some pins shoud be set by your tool changer in iocontrol
linuxcnc.org/docs/html/config/iov2.html#_pins
  • iocontrol.0.tool-changed (Bit, In) Should be driven TRUE when a tool change is completed.
The following user(s) said Thank You: JetForMe

Please Log in or Create an account to join the conversation.

More
31 Jan 2023 17:21 #263374 by HansU
You can try to connect to the signal/message "tool-info-changed" (linuxcnc.org/docs/2.9/html/gui/gstat.html#_messages).
The following user(s) said Thank You: JetForMe

Please Log in or Create an account to join the conversation.

  • JetForMe
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
31 Jan 2023 23:04 - 31 Jan 2023 23:05 #263405 by JetForMe
Replied by JetForMe on topic Getting notified of tool parameter changes?
That's great! So, what would the Python code to catch that look like?

EDIT: Oh! There's sample code at that link, sorry. Thanks!
Last edit: 31 Jan 2023 23:05 by JetForMe.

Please Log in or Create an account to join the conversation.

  • JetForMe
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
01 Feb 2023 01:54 #263412 by JetForMe
Replied by JetForMe on topic Getting notified of tool parameter changes?

You can try to connect to the signal/message "tool-info-changed" (linuxcnc.org/docs/2.9/html/gui/gstat.html#_messages).
 

Just a quick followup, this is exactly what I was hoping for, and works great, thank you!

The only minor caveat is that it's only called for the current tool (so if someone were to change and reload the tool table file for a tool not in the spindle, my code wouldn't get notified. But that's an edge case I can easily live with for now, probably forever. Also, current-tool-offset never seems to be sent, but that's also okay.

Please Log in or Create an account to join the conversation.

More
02 Feb 2023 04:50 #263495 by cmorley
Replied by cmorley on topic Getting notified of tool parameter changes?
Current tool offset is sent if the offsets are changed or differ when changing between tools.
Did you observe it not working that way?

Finding offset changes on non loaded tools is more involved.
gladevcp's tooledit_widget does it.
github.com/LinuxCNC/linuxcnc/blob/2.8/li...ledit_widget.py#L236

Please Log in or Create an account to join the conversation.

Moderators: HansU
Time to create page: 0.065 seconds
Powered by Kunena Forum