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”.

Read firstSinumerik R-Parameters & System VariablesSiemens SINUMERIK 828D reference for R-parameters, the $-prefix system variable naming scheme, useful runtime variables, and GUD — with Fanuc macro equivalents.

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

at X12.5, heading for X50:$AA_IM[X] = 12.5R1 = 50
at X-3, heading for X20:$AA_IM[X] = -3R1 = 20

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.