End to End: A Step Pattern

Put named starts, arithmetic and a loop together into one real parametric routine.

Time to assemble the pieces. A pilot-hole rig drills a straight row: a start position, a fixed pitch, and a hole count — all supplied by the caller so the same program serves any row. You'll walk the row with a loop and report back where it ended and how long it ran.

Read firstOkuma OSP Turning (Lathe) ProgrammingProgramming Okuma LB and Genos lathes on the OSP control: zero offsets instead of G54, the LAP contour-roughing cycles (G81/G80 definition, G85/G87 calls), G96 constant surface speed, G33 threading with VC-variable pass loops, and a Fanuc-to-OSP translation table.

Your turn

The row's start X is in VC1, the pitch in VC2, and the hole count in VC3. Walk the row with an IF[…]GOTO loop: keep the running X in VC10 (starting at VC1), step it by the pitch for each hole after the first, and count the holes placed in VC11. When you're done, set VC12 to the total row length (the last X minus the first).

The machine gives you

4 holes from X10 at 15 mm pitch:VC1 = 10VC2 = 15VC3 = 4
3 holes from X0 at 20 mm pitch:VC1 = 0VC2 = 20VC3 = 3

Your program is run once for each set of conditions. It has to work for all of them.

Loading...

This is a learning simulation — always prove out a program on the actual control before you cut metal.