Machine Log
02 Sep 2021 03:05 - 02 Sep 2021 03:06 #219390
by phillc54
Replied by phillc54 on topic Machine Log
Yeah, I just tried it and you can have a tool numbered -1 in the tool table, I wonder why?
I had always assumed tool #0 was the default tool but I see now that is not the case.
Some confusing stuff here, what I don't understand is is I run this code at the end of initialized in the handler
The result is:
I had always assumed tool #0 was the default tool but I see now that is not the case.
Some confusing stuff here, what I don't understand is is I run this code at the end of initialized in the handler
self.stat = linuxcnc.stat()
self.stat.poll()
print("\n######\n", self.stat.tool_in_spindle)
print(self.stat.tool_table[0][0], "\n######\n")
######
0
-1
######
Last edit: 02 Sep 2021 03:06 by phillc54.
Please Log in or Create an account to join the conversation.
02 Sep 2021 03:43 #219391
by cmorley
Replied by cmorley on topic Machine Log
I would bet one is just initialized wrong in the c/c++ code - cause - which number is right?
Please Log in or Create an account to join the conversation.
02 Sep 2021 03:45 #219392
by phillc54
Replied by phillc54 on topic Machine Log
I would like the zero to be correct but I am guessing it is not.
Please Log in or Create an account to join the conversation.
02 Sep 2021 03:47 #219393
by cmorley
Replied by cmorley on topic Machine Log
Might be worth putting in a bug report to get a discussion going.
Please Log in or Create an account to join the conversation.
02 Sep 2021 03:52 #219394
by phillc54
Replied by phillc54 on topic Machine Log
a quick look at emcmodule.cc shows:considering that tool #0 is a valid tool then my guess is that should be -1 if no tool is loaded so it is the same as tool_table[0][0]
{(char*)"tool_in_spindle", T_INT, O(io.tool.toolInSpindle), READONLY,
(char*)"The tool number of the currently loaded tool, or 0 if no tool is loaded."
Please Log in or Create an account to join the conversation.
02 Sep 2021 06:26 - 02 Sep 2021 06:28 #219405
by phillc54
Replied by phillc54 on topic Machine Log
More confusion, I think it may be best to just hide the first write to the machine log:
This code:
produces this result:Maybe it is just a timing issue during startup.
This code:
print("\n######")
print(" self.stat.tool_in_spindle: {:2} self.stat.tool_table[0][0]: {:2}".format(self.stat.tool_in_spindle, self.stat.tool_table[0][0]))
print("STATUS.stat.tool_in_spindle: {:2} STATUS.stat.tool_table[0][0]: {:2}".format(STATUS.stat.tool_in_spindle, STATUS.stat.tool_table[0][0]))
print("######\n")
######
self.stat.tool_in_spindle: -1 self.stat.tool_table[0][0]: -1
STATUS.stat.tool_in_spindle: 0 STATUS.stat.tool_table[0][0]: -1
######
Last edit: 02 Sep 2021 06:28 by phillc54.
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
Less
More
- Posts: 2388
- Thank you received: 779
02 Sep 2021 10:02 - 02 Sep 2021 10:04 #219424
by snowgoer540
The only LCNC gui that I have significant experience with, regarding tool changes (with no Automatic Tool Changer), is PathPilot and PathPilot remembers the last tool used every time you start it. Which means that they either "fixed" it, or it broke on our end at some point since they forked off.
I think that's what lead me down the path of thinking that the GUI sets the last tool used on startup, but it seem now this is not the case.
From a QtPlasmaC standpoint, I suppose it's not the end of the world.
For everyone else using tool changes, it seems like LCNC forgetting the last tool used would be inconvenient.
I also find it a bit interesting that LCNC does remember the last tool if you have "RANDOM_TOOLCHANGER" set to 1, but I've also not looked into why/the code at all.
Replied by snowgoer540 on topic Machine Log
It's strange that no one has officially made linuxcnc remember the last tool it used before shutdown.
I would have thought it reasonably simple for a dev who knows the code.
The only LCNC gui that I have significant experience with, regarding tool changes (with no Automatic Tool Changer), is PathPilot and PathPilot remembers the last tool used every time you start it. Which means that they either "fixed" it, or it broke on our end at some point since they forked off.
I think that's what lead me down the path of thinking that the GUI sets the last tool used on startup, but it seem now this is not the case.
From a QtPlasmaC standpoint, I suppose it's not the end of the world.
For everyone else using tool changes, it seems like LCNC forgetting the last tool used would be inconvenient.
I also find it a bit interesting that LCNC does remember the last tool if you have "RANDOM_TOOLCHANGER" set to 1, but I've also not looked into why/the code at all.
Last edit: 02 Sep 2021 10:04 by snowgoer540.
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.081 seconds