F
3--
04
A
D
S
4-
C
h.
Is
ola
te
d
A
na
lo
g
In
.
3--15
F3--04ADS 4-Channel Isolated Analog Input
The following instructions are required to scale the data. We’ll continue to use the
42.9 PSI example. In this example we’re using channel 1. Input 114 is the active
channel indicator for channel 1. Of course, if you were using a different channel, you
would use the active channel indicator point that corresponds to the channel you
were using.
114
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
K100
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 then multiplied by the scaling
factor, which is 100. (100 x 4296 = 429600). Notice
the most significant digits are now stored in the
auxilliary accumulator. (This is different from the
way the Divide instruction operates.)
9
6
0
0
Accumulator
0
0
4
2
Aux. Accumulator
R577
R576
R577
R576
R577
R576
R577
R576
This instruction moves the two-byte auxilliary
accumulator for further operations.
0
0
4
2
Accumulator
0
0
4
2
Aux. Accumulator
R577
R576
This instruction stores the accumulator to R450.
R450 now contains the PSI, which is 42 PSI.
0
0
4
2
Accumulator
0
0
4
2
Store in R451 & R450
R451
R450