Reading Machine State
Read a $-system variable into an R-parameter and compute with it.
The $-prefixed system variables are the control's own live values — $AA_IM[X] is where X is right now in the machine frame. On this control they are read-only: you can copy one into an R-parameter (R1 = $AA_IM[X]) and do maths with it, but assigning to one raises “system variables are read-only in the playground”.
Your turn
The current machine X position is in $AA_IM[X] and a target position is waiting in R1. Copy the live position into R3, and set R2 to the distance still to travel (target minus current).
The machine gives you
$AA_IM[X] = 12.5R1 = 50$AA_IM[X] = -3R1 = 20Your 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.