Hello
As the rod-loader is conventionally controlled, I guess it is continuously under pressure.
Then you can write it completely in the upper part of the main program.
However, I personally would write a macro which is suitable for all kind of lengths.
Then you only need to change the Z value in the main program.
The macro call would look like this:
%
O5116
G59Z195 <--- change Z values here if you have a different length
(AUDI PART 116)
L101=0
L102=0
G211Z195T60.3D35X0S0F0C0R0H1 <---- and here change the Z value – the ‘D’ value refers to the raw workpiece diameter
G27
Macro example
%
O9811
( control new rod )
L48=L522
IFL101EQ0GOTO212
IFL101LTL507GOTO200
N212L101=L507
/G22P209Q216
/!
M31
N200IFL101EQ3GOTO202
IFL101EQ2GOTO203
IFL101EQ1GOTO204
N202G24
G59X0ZL48
G97S200T202M4
G0Z5
G0X0
G0Z-L516M77
G94M11
B055000+L501+3
G1Z-[L516-L501]F4000
G95M10
G4X1
G0W5M78
L101=L101-1
G24
L46=L522-L516+L501
G59X0ZL46
GOTO210
N203G24
.
.
.
.
and so on...