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.
This example assumes you have already read the analog data
and stored the BCD equivalent in R400 and R401
Scale the data
114
115
116
DSTR
R400
DIV
K4096
DSTR
R576
MUL
K1000
DSTR
R576
DOUT
R450
F3–08AD–1 8-Channel Analog Input
This instruction brings the analog value (in BCD)
F50
into the accumulator.
Accumulator
1
7
6
0
The analog value is divided by the resolution of the
F74
module, which is 4096. (1760 / 4096 = 0.4296)
Accumulator
0
0
0
0
This instruction moves the two-byte decimal
F50
portion into the accumulator for further operations.
Accumulator
4
2
9
6
The accumulator is multiplied by the scaling factor,
F73
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.)
Accumulator
6
0
0
0
F50
This instruction moves the two-byte auxilliary
accumulator for further operations.
Accumulator
0
4
2
9
F60
This instruction stores the accumulator to R450
and R451. R450 and R451 now contain the PSI,
which implies 42.9.
Accumulator
0
4
2
9
4–13
Aux. Accumulator
0
0
0
0
R577
R576
Aux. Accumulator
4
2
9
6
R577
R576
Aux. Accumulator
4
2
9
6
R577
R576
Aux. Accumulator
0
4
2
9
R577
R576
Aux. Accumulator
0
4
2
9
R577
R576
Store in R451 & R450
0
4
2
9
R451
R450
Need help?
Do you have a question about the DL305 and is the answer not in the manual?