Hi there,
I am currently using a custom G-code on our lathe to safely call up a tool and turn on spindle, coolant etc.
Here is the calling code:
G800 T0101 X1.7 Z.05 S500. M8
I would like to be able to program in the tool nose radius and tool tip direction using the system variables. So based off of the tool offset value (TXXXX) in the calling G-code it could automatically set the correct tool nose radius and tool tip vector from the program.
Something like this:
Where
V = tool tip vector
R = tool nose radius
G800 T0101 X1.7 Z.05 S500. M8 V3. R.032
I have considered automatically assigning a tool offset value based on the turret pos which I think I could get to work, but would like to be able to leave Turret position and offset in calling program if possible.
I am not sure if there is a way to do this?
Any ideas / help appreciated.
Thanks
If any is curious I found a solution after playing around with for a few days.
Below is code that will set tool tip vector and tool nose radius based off of the "T" values offset in the G65 line.
G65 P8004 T0101 Q3. R.032
O8004(OFFSET PROGRAM)
#1=#4120 (STORE CURRENT TXXX IN USE)
#2=#1/100
#3=FIX[#2]
#4=#2-#3
#4=ROUND[#4*100](THIS VAR HOLDS OFFSET VALUE)
G10 P[10000+#4] Q#17 R#18
M00
M30