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.
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
VC1 = 10VC2 = 15VC3 = 4VC1 = 0VC2 = 20VC3 = 3Your program is run once for each set of conditions. It has to work for all of them.
This is a learning simulation — always prove out a program on the actual control before you cut metal.