I found a floppy disk with a few interesting files on it - from my past life with Cincinnati Milacron Electronic Systems Division / Vickers / Siemens. I was involved with A850SX and A2100 mainly. I recall writing a subroutine like this for 850/950 and I'm pretty sure I modified it for A2100...anyhow, reproduced here for your benefit. Use with care...I can't remember exactly what moves it made!
Ron
(PGM, NAME="external thread sub example", TYPE="A2100_274", EXEMODE="STANDARD", PATH="PATHALL", ACCESS="OPEN", CREATED="THU MAR 16 2000 12:46:22", MODIFIED="THU MAR 16 2000 13:37:06", LEVEL="1")
:G0 G70 T5 M6
N010 X7.0 Y5.0 Z-10.0 F200. S2000 M3
N020; Use parameters in the CLS block to pass information to the subroutine: X, Y=center of boss in X and Y, Z=surface of part, K=thread lead, D=depth of thread from surface, O=major diameter, F=feedrate at tool tip
N030; starting condition requirements: Correct tool in spindle at proper RPM, coolant specified as desired, all parameters specified in above line established
N040; Tool data for nominal diameter and diameter offset must be correct!
N050; Subroutine makes one pass only!
N060 (CLS, "helical sub" X7.0 y5 Z-11 D1 K0.06 O1.9875 F100)
N070 M2
;
;
N100 (DFS, "helical sub");this sub threads from bottom to top!
N120 (MSG,Position over center of boss, 0.100" above part surface)
N120 G90 X[&X] Y[&Y] Z[&Z]+0.100
N130 (MSG,Move X and Y clear to upper RH of boss)
N130 G00 X[&X]+([&O]+[$tool_data(0)nom_dia]+[$tool_data(0)dia_offset])/2 Y[&Y]+([&O]+[$tool_data(0)nom_dia]+[$tool_data(0)dia_offset])/2;
N140 (MSG,Drop Z to bottom of thread)
N140 G0 Z[&Z]-abs([&D]);
N150 (MSG,Feedrate move X to 12:00 position)
N150 g1 X[&X] F!;
N160 [#numthreads]=abs([&d]/[&K]);calculate number of helical arcs
N170 [#degrees]=([#numthreads]-int([#numthreads]))*360+90;calculate degrees in last partial arc
N180 (MSG,CCW helical milling ;int([#numthreads]):3.0; full circles plus ;([#numthreads]-int([#numthreads]))*360:6.3; degrees)
N190 F([&O]+[$tool_data(0)nom_dia]+[$tool_data(0)dia_offset])*[&F]/[&O];set feedrate taking cutter diameter into consideration
N200 g3 X[&X] Y[&Y] Z[$curpos_pgm(Z)]+[#numthreads]*[&K] E[#degrees] L([&O]+[$tool_data(0)nom_dia]+[$tool_data(0)dia_offset])/2 I[&X] J[&Y] K[&K]
N210 (MSG,Retract Z to work surface = 0.100")
N210 G0 Z[&Z]+.10 F[&F];retract Z to top of part + 0.1 clearance
N220 (MSG, Move X and Y to center)
N220 X[&X] Y[&Y];not required, just for the hell of it
N230 (MSG,)
N230 (ENS)