Machine Log
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
One that always shows up in the machine log at startup is "Tue31 21:31 Tool 0: No Tool". It does not throw the error pop-up, but in QtPlasmaC all errors/warnings are visible in the Statistics tab under the Machine Log section, and also make it to the machine log files.
As this particular error/warning has no meaning in QtPlasmaC, I am wondering what the easiest way to suppress it might be, as where exactly it comes from?
Thanks for the help!
-Greg
Please Log in or Create an account to join the conversation.
I used this code after L373 which is: self.old = self.stat.tool_table[0] to show the above.
t = ''
for l in range(len(self.stat.tool_table)):
t += ' ' + str(self.stat.tool_table[l][0])
print("stat.tool_table:{} current_tool:{}".format(t, self.get_current_tool()))
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
ACTION.CALL_MDI('T0 M6')
In the correct place during the initialization process?
I haven't spent much time on it this morning as work beckons so I apologize if that feels kind of work-around and not really a solution.
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
When LinuxCNC is configured for a nonrandom toolchanger (see the entry for RANDOM_TOOLCHANGER in the EMCIO Section), T0 gets special handling: no tool will be selected. This is useful if you want the spindle to be empty after a tool change.
And goes on to say:
When LinuxCNC is configured for a random toolchanger (see the entry for RANDOM_TOOLCHANGER in the EMCIO Section), T0 does not get any special treatment: T0 is a valid tool like any other. It is customary to use T0 on a random toolchanger machine to track an empty pocket, so that it behaves like a nonrandom toolchanger machine and unloads the spindle.
So, for fun, I added "RANDOM_TOOLCHANGER = 1" under the [EMCIO] section. When I started QtPlasmaC the first time with Phill's suggested code in hal_glib.py, both the stat.tool_table and current_tool were -1.
So, I did an M6 T0 and restarted. Now every time I start it says "Tool 0: torch", and both values from above are 0 in the terminal.
Similarly, if I do a M6 T1, every time I start it says "Tool 1: scribe"
While I think this feels like a step in the right direction, I am not sure this is the solution. I don't think we want QtPlasmaC to default to the last used tool used on startup. I think we want it to default to the first tool in the tool table (T0 in our case).
I think the best solution is to figure out a way to make it so that QtPlasmaC (LCNC in this case) does not assume an empty spindle on startup. It needs to default to 0 instead of -1 I think. So M6 T0, but at startup lol. Basically what Phill's saying.
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
I guess I’m confused as to why if QtPlasmaC defaults to tool 0, it doesn’t report tool 0 as the torch? Why does it default to tool -1? Or better how can we get it to default to tool 0 instead of -1 instead?
I’m guessing it just is how linuxcnc works, but I think I’m also missing where the tool gets set to 0 then…
Please Log in or Create an account to join the conversation.
Tool 0 is the reported tool if you check STATUS.get_current_tool(). There is a difference with that and what linuxcnc.stat() reports as shown in this previous post:
forum.linuxcnc.org/qtvcp/43487-machine-log#219311
Please Log in or Create an account to join the conversation.
- snowgoer540
- Topic Author
- Offline
- Moderator
- Posts: 2388
- Thank you received: 779
Please Log in or Create an account to join the conversation.
That seems a pretty reasonable way to go.Following the yellow brick road shows that the log is updated for tools at line 485 of screen_options.py. If I make that dependent on the machine power status then it doesn't log the initial tool state. It is probably only a kludge though.
You can also add a tool -1 to the tool file and get another answer.
Though the default 'no tool' comes from qt_tstat.py when one asks for info on a tool not in the toolfile.
I defaults to all tool 0, all data zero and the comment 'No Tool' I guess it should default to current tool - then it would be -1 on start up.
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.
I never did understand the T0-can-mean-different-things problem either. - it messes up lathes too (T0 is a valid number usually)
Chris
Please Log in or Create an account to join the conversation.