F
3-
-0
8T
H
M
--n
8C
h.
T
he
rm
oc
ou
pl
e
In
.
9--16
F3--08THM--n 8-Channel Thermocouple Input
You probably noticed the previous example yielded 42 PSI when the real value
should have been 42.9 PSI. By changing the scaling value slightly, we can “imply” an
extra decimal of precision. Notice in the following example 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.
DSTR
R400
F50
DIV
K4096
F74
This instruction brings the analog value (in BCD)
into the accumulator.
This instruction moves the two-byte decimal
portion into the accumulator for further operations.
Scale the data
The analog value is divided by the resolution of the
module, which is 4096. (1760 / 4096 = 0.4296)
DSTR
R576
F50
MUL
K1000
F73
DSTR
R576
F50
DOUT
R450
F60
1
7
6
0
Accumulator
0
0
0
0
Aux. Accumulator
0
0
0
0
Accumulator
4
2
9
6
Aux. Accumulator
This example assumes you have already read the analog data
and stored the BCD equivalent in R400 and R401
4
2
9
6
Accumulator
4
2
9
6
Aux. Accumulator
The accumulator is multiplied by the scaling factor,
which is now 1000. (1000 x 4296 = 4296000). The
most significant digits are now stored in the
auxilliary accumulator. (This is different from the
way the Divide instruction operates.)
6
0
0
0
Accumulator
0
4
2
9
Aux. Accumulator
R577
R576
R577
R576
R577
R576
R577
R576
This instruction moves the two-byte auxilliary
accumulator for further operations.
0
4
2
9
Accumulator
0
4
2
9
Aux. Accumulator
R577
R576
This instruction stores the accumulator to R450
and R451. R450 and R451 now contains the PSI,
which implies 42.9.
0
4
2
9
Accumulator
0
4
2
9
Store in R451 & R450
R451
R450
114
115
116