Current Tool-number permanent?
25 Jun 2016 09:27 #76638
by andypugh
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)2) puttingIn the [RS274NGC] section of the INI file
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.
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
Replied by andypugh on topic Current Tool-number permanent?
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)
O<change> sub
M6
#4999 = #5400
O<change> endsub
m2
REMAP=M6 modalgroup=6 ngc=change
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
The following user(s) said Thank You: terkaa
Please Log in or Create an account to join the conversation.
25 Jun 2016 12:27 #76639
by terkaa
Replied by terkaa on topic Current Tool-number permanent?
Hi,
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
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 or Create an account to join the conversation.
29 Jun 2016 21:19 #76804
by andypugh
Replied by andypugh on topic Current Tool-number permanent?
This made me start a whole new wiki page:
wiki.linuxcnc.org/cgi-bin/wiki.pl?This_Should_Be_Easier
Hopefully this perfectly reasonable requirement will be easier in the next release.
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 or Create an account to join the conversation.
30 Jun 2016 04:51 #76820
by terkaa
Replied by terkaa on topic Current Tool-number permanent?
Hi,
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.
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 or Create an account to join the conversation.
30 Jun 2016 09:55 #76825
by andypugh
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.
Replied by andypugh on topic Current Tool-number permanent?
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 or Create an account to join the conversation.
30 Jun 2016 12:06 - 30 Jun 2016 12:06 #76834
by terkaa
Replied by terkaa on topic Current Tool-number permanent?
Hi,
I did not set this as random, because it is not random. Is this fix valid on 2.7.4?
Tero
I did not set this as random, because it is not random. Is this fix valid on 2.7.4?
Tero
Last edit: 30 Jun 2016 12:06 by terkaa.
Please Log in or Create an account to join the conversation.
30 Jun 2016 13:04 - 30 Jun 2016 13:04 #76835
by andypugh
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.
Replied by andypugh on topic Current Tool-number permanent?
What you have is correct, I was just checking.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
O<reload_tool> SUB
O100 IF [#4999 EQ 0]
M6 T0
O100 ELSE
M61 Q#4999
O100 ENDIF
O<relaod_tool> ENDSUB
M2
Or similar.
Last edit: 30 Jun 2016 13:04 by andypugh.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1409
30 Jun 2016 14:32 #76844
by Todd Zuercher
Replied by Todd Zuercher on topic Current Tool-number permanent?
I've been watching this from afar with mild interest. I've not set up any Linuxcnc machines with tool changers but, I do have one who is a good candidate for a retrofit with one.
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)
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 or Create an account to join the conversation.
19 Sep 2016 11:32 #80600
by terkaa
Replied by terkaa on topic Current Tool-number permanent?
Hi,
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
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 or Create an account to join the conversation.
Time to create page: 0.145 seconds