Arithmetic & Brackets
Control the order of operations with square brackets on the OSP.
Okuma does * / before + -, same as arithmetic class. Square brackets override that: [VC1 + 5] * 2 adds first, then doubles. Get the brackets wrong and the control happily computes the wrong number — there's no error, just a bad part.
Your turn
The machine hands you a value in VC1. Set VC2 to [VC1 + 5] * 2 — the five must be added before the doubling, so it needs brackets. Then set VC3 to a quarter of VC1.
The machine gives you
VC1 = 10:
VC1 = 10VC1 = 20:
VC1 = 20Your 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.