G116 tool change macro reordering
we are using the macro typed out below to handle the tool changes in our okuma mb56va mills and there's a certain behavior i would like to change.
when we run a program (cycle start) and the tool needed is currently in the spindle, the spindle will first drive all the way up "G0Z5000" and THEN check if the correct tool is in the spindle and THEN go back down and start the operation. what i would like to change is have to machine FIRST check if the tool is the spindle and if it's not then use "G0Z5000". and if called tool IS currently in the spindle then start operation. seems like a simple change in the code but i'm not very fluent at this kind of stuff so if anybody could do it for me i would thank you in advance :)
OATC1
(TOOL CHANGE MACRO)
(COMMAND IS G116 T?? Q??)
(T=DESIRED TOOL #, Q=NEXT TOOL #)
(G116 T0 WILL CLEAR TOOL FROM SPINDLE)
(FEB 5, 2004)
M329
M5
G0Z5000
IF[PT EQ 0]NMT
IF[VTLCN EQ PT] NFIN
IF[VNTOL EQ PT] NCH
IF[VNTOL EQ 0] NCHG
M64
NCHG T=PT M6
NFIN IF[VNTOL EQ 0] NTL
IF[VNTOL NE PQ] NCLR
GOTO NEND
NCH M6
GOTO NFIN
NCLR M64
NTL T=PQ
GOTO NEND
NMT IF[VNTOL EQ 0]NRID
M64
NRID M63
M6
NEND RTS
Re: G116 tool change macro reordering
got the answer to my question. good thing my brother understands coding language cause i hardly expected any answer from this forum within a day....or week. so here goes, for those of you who might wanna use it as well.
all you need to do is add this line of code IF[VTLCN EQ PT] NEND right before G0Z5000 so what it does now is first check if the tool called from the G116 macro is in the spindle, and if it is the code will go directly to NEND which is RTS which is the end of the macro which means the operation will continue. And if it's not, the macro will just skip along checking all the switches, changing tools till it's happy... :)
good luck and have fun... :D