User manual

28
11 Computing with Variables
Until now, the parameters have used only consistent number values in the parameters of the
individual commands. This is sensible when a programme is to run the same way every time.
More complex programmes, however, work with variable data. E.g. a calculation such as A = A
+ B can be executed. Depending on the content of the variables A and B, something different
will result each time. The result could control the LEDs at the outputs as follows, for example.
The control has the four variables A, B, C and D. The most important variable is A. It is also
called the
accumulator
or briefly
Accu
. A is involved in all computing operations and receives the
computation result. A is also used for data transport. B is mostly needed for computing
operations. C and D can be used as interim memories and are later needed as counters for
counting loops.
There also are two analogue inputs (AD1 and AD2) and a PWM-output. The processed data are
limited to four bit and only accessible via variable A (A = AD1, PWM = A). Accumulator A can
also be loaded directly with a number (commands 404F). To fill B, C or D, first load A and then
assign the content to the other variable (commands 5153). A and B permit some computing
steps (commands 717A).
The commands 404F assign A a new value. The command group 515A transfers the content
of A to a target such as another variable or the PWM output. In this group, there also are
commands that set a single bit of the output port.
The other data direction is present in the command group 616A, where data from a source are
read into A. The command group 717A finally performs a few computing operations with the
result generally appearing in A. The output port Dout comprises the four outputs A1 to A4, which
can be tripped either together or as individual bits Dout.0 to Dout.3. The inputs E1 to E4 are
triggered equally as input port Din.
404F: A = 015
515A: Target 19 = A
51: B = A
52: C = A
53: D = A
54: Dout = A
55: Dout.0 = A.0
56: Dout.1 = A.0
57: Dout.2 = A.0
58: Dout.3 = A.0
59: PWM = A
616A: A = Source 110
61: A = B
62: A = C
63: A = D
64: A = Din