F
3-
-0
8T
H
M
--n
8C
h.
T
he
rm
oc
ou
pl
e
In
.
9--10
F3--08THM--n 8-Channel Thermocouple Input
The following example shows a program designed to read any of the available
channels of data into Register locations. Once the data is in a Register, you can
perform math on the data, compare the data against preset values, etc. Since the
DL305 CPUs use 8-bit word instructions, you have to move the data in pieces. It’s
simple if you follow the example.
374
DSTR3
R011
F53
Read the data
This rung loads the four data bits into the
accumulator from Register 011 on every scan.
DOUT1
R501
F61
114
DOUT
R400
F60
Store channel 1
DOUT
R402
F60
Store channel 2
DOUT
R404
F60
Store channel 3
The channel selection inputs are used to let the
CPU know which channel has been loaded into the
accumulator. By using these inputs to control a
DOUT instruction, you can easily move the data to
a storage register. Notice the DOUT instruction
stores the data in two bytes. (Two bytes are
required for four digit BCD numbers.)
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. (You
can omit this step if your application does not
require the conversion.)
115
116
114
115
116
114
115
116
114
DOUT
R406
F60
Store channel 4
DOUT
R410
F60
Store channel 5
DOUT
R412
F60
Store channel 6
115
116
114
115
116
114
115
116
DOUT
R414
F60
Store channel 7
DOUT
R416
F60
Store channel 8
114
115
116
114
115
116