Toolchanging code problem

More
12 Aug 2022 17:01 #249604 by raychar
In usual cnc machining works, auto toolchanging G-code (let say to choose tool no.3) M6T3 is incorporated in cnc machining program. After the subroutine is called, the probing and storing the offset value done. It will go back to main machining program, the next code is H3 for apply tool offset for the selected tool. Then the rest of machining works carry on accordingly.
However, in my case, I install some external buttons for tool selection. I just want to hit the button keys to choose tools. So I can do manual cutting work as well. This was already achieved, M6T3 subroutine was called, probing operation and storing the the tool Z offset to the tool table were done. 
However, I also want the applying of the tool offset immediately. So, in the M6 subroutine, I added #<tool> after G43 (please see below lines of codes), but there is no effect occurred after running, that is, there is no offset(compensated) reading shown on Z DRO.
What is the reason, can anybody help and explain to resolve?
...
...
O500 if [#5070 EQ 0]
G90
O500 return [-3] ; indicate probe contact failure to epilog
O500 endif

G90
G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]

#<touch_result> = #5063
#<probeheight> = #<_hal[gmoccapy.probeheight]> 
#<blockheight> = #<_hal[gmoccapy.blockheight]>

;(DEBUG, #<touch_result>  #<probeheight>  #<blockheight>)

G10 L1 P#<_tool> Z[#<touch_result> - #<_hal[gmoccapy.probeheight]> + #<_hal[gmoccapy.blockheight]>]
G43 #<tool>  

;G10 L1 P#<tool> Z#<touch_result>
;G10 L2 P0 Z[#<workpieceheight> + #<probeheight> + #<touch_result>]

; signal success be returning a value > 0:
o<change> endsub [1]

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

More
12 Aug 2022 19:13 #249615 by cmorley
Replied by cmorley on topic Toolchanging code problem
where does #<_tool> come from?

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

More
15 Aug 2022 13:04 - 15 Aug 2022 13:04 #249781 by mgm
Replied by mgm on topic Toolchanging code problem
G43 without an H word uses the currently loaded tool from the last Tn M6.
quote from the manuel
Last edit: 15 Aug 2022 13:04 by mgm.

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

More
16 Aug 2022 10:55 #249879 by raychar
Replied by raychar on topic Toolchanging code problem
Previous codes are in change.ngc file, it is called when i hit external buttons which is linked in .ini file to MDI command M6T0~M6T6 for the respectively 7 tool selections. Even i changed the corresponding line to G43 H3 (adding H3), there is no changing in the Z DRO after the execution.Remarks: my programs already worked to do the toolchanging except the said problem. It is for the rack type 7 tool pockets tool changer box, it is motorized by two motors in moving ti forward and backward and also rotating pockets clockwise and anti-clockwise. The attached folders codes are written quite messy and without comments for explanation.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum