F
3--
08
T
E
M
P
8C
h.
Te
m
pe
ra
tu
re
In
pu
t
10--13
F3--08TEMP 8-Channel Temperature Input
Once you’ve read the data and converted it to a temperature, you can use the
channel selection inputs to store each of the eight channels. Once you’ve stored the
data you can perform data comparisons, additional math, etc.
DIV
K4096
F74
This instruction moves the two-byte decimal
portion into the accumulator for further operations.
Scale the data
The analog value is divided by
_
C scaling factor,
which is 4096. (1733 / 4096 = 0.4230)
DSTR
R576
F50
SUB
K2732
F72
Now subtract the
_
K offset from the accumulator.
(The
_
K offset is 2732, which represents 273.2
_
.
DSTR3
R011
F53
Read the data
This rung loads the four data bits into the
accumulator from Register 011.
DOUT1
R501
F61
Temporarily store the bits to Register 501.
DSTR1
R001
F51
This rung loads the eight data bits into the
accumulator from Register 001.
DOUT1
R500
F61
Temporarily store the bits to Register 500. Since
the most significant bits were loaded into 501, now
R500 and R501 contain all twelve bits in order.
DSTR
R500
F50
BCD
F86
Now that all the bits are stored, load all twelve bits
into the accumulator.
Math operations are performed in BCD. This
instruction converts the binary data to BCD. (We’ll
have to use math to convert the value to a
temperature.)
DOUT
R500
F60
Store 0000 in the accumulator. This will allow us to
calculate the correct value.
Below zero correction
If 775 is on, the value is temporarily stored in
registers (R500 and R501 in this case).
DSTR
K0000
F50
SUB
R500
F72
Now subtract the original answer (which was
0699.) 0 -- 0699 = 0301, or 30.1
_
C
775
114
DOUT
R400
F60
Store channel 1
DOUT
R402
F60
Store channel 2
115
116
114
115
116
DOUT
R416
F60
Store channel 8
114
115
116
Use the channel selection bits to determine which
channel is active. For example, this rung stores
channel 1 temperature in registers 400 and 401.
374
374
374
Storing the
Temperature