F
3--
04
D
A
--1
4-
C
ha
nn
el
A
na
lo
g
O
utp
ut
7--11
F3--04DA--1 4-Channel Analog Output
There will probably be times when you need more precise control. For example,
maybe your application requires 42.9 PSI, not just 42 PSI. By changing the scaling
value slightly, we can “imply” an extra decimal of precision. Notice in the following
example we’ve entered 429 as the Engineering unit value and we’ve added another
digit to the scale. Instead of a scale of 100, we’re using 1000, which implies 100.0 for
the PSI range.
374
DSTR
R400
F50
DIV
K1000
F74
This instruction loads Engineering unit value into
the accumulator on every scan.
If not equal to one, this instruction moves the
two-byte decimal portion into the accumulator for
further operations.
Scale the data
The Engineering unit value is divided by the
Engineering unit range, which in this case is 1000.
(100.0 implied range)
DSTR
R576
F50
MUL
K4096
F73
DSTR
R576
F50
DOUT
R450
F60
0
4
2
9
Accumulator
0
0
0
0
Aux. Accumulator
0
0
0
0
Accumulator
4
2
9
0
Aux. Accumulator
This example assumes you have already loaded the Engineering unit
value in R400.
4
2
9
0
Accumulator
4
2
9
0
Aux. Accumulator
The accumulator is then multiplied by the module
resolution, which is 4096. (4096 x 4290 =
17571840). Notice the most significant digits are
now stored in the auxilliary accumulator. (This is
different from the Divide instruction operation.)
1
8
4
0
Accumulator
1
7
5
7
Aux. Accumulator
R577
R576
R577
R576
R577
R576
R577
R576
This instruction moves the two-byte auxilliary
accumulator for further operations.
1
7
5
7
Accumulator
1
7
5
7
Aux. Accumulator
R577
R576
This instruction stores the accumulator to R450
and R451. R450 and R451 now contain the digital
value, which is 1757.
1
7
5
7
Accumulator
1
7
5
7
Store in R451 & R450
R451
R450
CMP
K1
F70
Compare for equal to 1000 (1000 div 1000 = 1).
DSTR
K4095
F50
DOUT
R450
F60
773
If equal to one, store 4095 into the accumulator.
If equal to one, move 4095 from accumulator to
R450.
773