Decisions with IF / ENDIF
Branch on a seeded value with an IF / ELSE / ENDIF block.
An IF … ENDIF block lets a program decide. The condition uses plain symbols — >, <, >=, ==, <> — and an optional ELSE gives the other path. This is the moment a program stops being a list of moves and starts being software.
Your turn
A feed value arrives in R1. Clamp it to a ceiling of 100: if R1 is above 100, set R2 to 100; otherwise set R2 to R1 unchanged.
The machine gives you
150 requested — over the ceiling:
R1 = 15050 requested — under the ceiling:
R1 = 50Your 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.