The Bolt Circle
Combine R-parameters, trig, a loop and indirect addressing into one parametric routine.
This is where it all comes together. Read the circle centre from the machine, loop over the holes, compute each one's X with trig, and stash the results in a table using indirect addressing — R[10 + R5] lands hole n in R(10+n). Change the count, the radius or the setup and nothing else moves.
Your turn
Drill a bolt circle centred on the live machine X ($AA_IM[X]). The hole count is in R1 and the radius in R2. Loop with R5 as the index from 0; for each hole compute the angle (R5 * 360 / R1) and store its X — centre plus radius times the cosine of the angle — into R[10 + R5]. So hole 0 lands in R10, hole 1 in R11, and so on.
The machine gives you
$AA_IM[X] = 100R1 = 4R2 = 40$AA_IM[X] = 0R1 = 4R2 = 40Your 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.