- Posts: 19306
- Thank you received: 0
Current Tool-number permanent?
terkaa wrote: That does not seem to work either.
What sort of "not work"?
I have managed to make it work by
1) putting a file called "change.ngc" in the nc_files directory. (there are better places, but we can work on that later)
3) Adding parameter 4999 to the .var file associated with the config to make it "sticky"
(I tried adding #5400 to the .var file, but that doesn't work. Perhaps it should be made to)
This does only solve the problem if saving the last-loaded tool for next time, the G61 at startup is a separate problem.
But it does not work because cinci.var file is already opened by LinuxCNC so writing is not possible. Is there an example of Python writing variables?
Yes, in fact there is an example in the built-in files that are associated with remapping routines.
github.com/LinuxCNC/linuxcnc/blob/master...glue/stdglue.py#L109
Please Log in to join the conversation.
Ok I went steps through again and yes it does work now. I defined SUBROUTINE_PATH = macros and put change.ngc there. Reading this saved tool number I arranged by:
MDI_COMMAND = M61 Q#4999 in ini
and
net machine_enabled halui.mdi-command-00 in HAL
Tero
Please Log in to join the conversation.
wiki.linuxcnc.org/cgi-bin/wiki.pl?This_Should_Be_Easier
Hopefully this perfectly reasonable requirement will be easier in the next release.
Please Log in to join the conversation.
This method also has one problem. I made command M6 T0 to remove current tool from spindle and leave spindle empty. If tool number in .var file is 0 then M61 Q#4999 sets tool number = -1 That is still a problem on my configuration.
Please Log in to join the conversation.
terkaa wrote: If tool number in .var file is 0 then M61 Q#4999 sets tool number = -1 That is still a problem on my configuration.
Do you have RANDOM_TOOCHANGER set to true?
The behaviour is all set here
github.com/LinuxCNC/linuxcnc/blob/2.7/sr.../iotask/ioControl.cc
But note that the last change to this file is
github.com/LinuxCNC/linuxcnc/commit/3218...41704632b7767cb6412f
So it seems that your problem is an actual bug that has been fixed.
Please Log in to join the conversation.
I did not set this as random, because it is not random. Is this fix valid on 2.7.4?
Tero
Please Log in to join the conversation.
What you have is correct, I was just checking.terkaa wrote: I did not set this as random, because it is not random.
As far as I can tell, yes. I have had a look at the code and can't quite track down where M61 is acted on. It may be that the fix only works for M6.Is this fix valid on 2.7.4?
The easiest way to be sure may be to modify your system so that instead of:
MDI_COMMAND = M61 Q#4999 in ini
You have
MDI_COMMAND = O<reload_tool> CALL
and then have a reload_tool G-code macro along the lines of
Or similar.
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Might it work if you set up the changer as a random, set up a T0 as NO TOOL, then remapping M6 to do two tool changes, exchanging T0 with the tool in the spindle and using it as a place holder to keep the pocket empty?
Kind of like this.
T0 in spindle
command T2 M6 would put T0 in pocket 2
next tool change
T5M6 (remap would do T0M6 to put too 2 back in pocket 2 then T5M6 to pick up tool 5 and put T0 in pocket 5)
Please Log in to join the conversation.
For some reason this only works randomly. Sometimes after reboot there is correct tool no but mostly there is 0. I will go around this by adding M6 T0 at the end of program so tool pot will be empty when machine is shutdown.
Tero
Please Log in to join the conversation.
