Indirect Addressing with R[R1]
Use one R-parameter as the index into another — the Siemens superpower.
Here's the trick no Fanuc macro does as cleanly. R[R1] doesn't mean R-parameter number one — it means “the R-parameter whose number is in R1”. If R1 holds 7, then R[R1] is R7. That one line of indirection is how a SINUMERIK program walks a table without knowing the addresses at write time.
Your turn
R1 holds a destination slot number and R2 holds a value. Write twice that value into the R-parameter that R1 points at — using R[R1], not a fixed address.
The machine gives you
R1 points at slot 7:
R1 = 7R2 = 9R1 points at slot 12:
R1 = 12R2 = 5Your 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.