D
3--
04
A
D
4-
C
ha
nn
el
A
na
lo
g
In
pu
t
2--11
D3--04AD 4-Channel Analog Input
Writing the Control Program
Since all channels are multiplexed into a single data word, the control program must
be setup to determine which channel is being read. Since the module provides input
points to the CPU, it is very easy to use the channel status bits to determine which
channel is being monitored.
1
1
0
D3--04AD
R 011
MSB
LSB
R 001
MSB
LSB
0
1
0
R 002, R012
R 000, R010
1
1
7
8pt
Relay
8pt
Output
16pt
Input
16pt
(Analog)
4ch.
Input
8pt
Output
050
--
057
040
--
047
030
--
037
020
027
--
120
127
000
007
--
100
107
010
017
--
110
117
0
1
7
-- not used
The following example shows a program that is designed to read a single channel of
analog data into a Register location on every scan. Once the data is in a Register,
you can perform math on the data, compare the data against preset values, etc. This
example is designed to read channel 1. If you choose another channel, you would
have to add a rung (or rungs) that use the channel select bits to select the channel for
scanning. You would also have to change the rung that stores the data.
374
DSTR1
R001
F51
Read the data
This rung loads the data into the accumulator on
every scan. (You can use any permissive contact.)
BCD
F86
110
DOUT
R400
F60
Store channel 1
The channel selection inputs are used to let the
CPU know which channel has been loaded into the
accumulator. Channel 1 input has been used in the
example, but you could easily use a different input
for a different channel. By using these inputs to
control a DOUT instruction, you can easily move
the data to a storage register. The BCD value will
be stored in R400 and R401. (Two bytes are
required for four digit BCD numbers.)
The DL305 CPUs perform math operations in
BCD. This instruction converts the binary data to
BCD. (You can omit this step if your application
does not require the conversion.)
Identifying the
Data Locations
Single Channel on
Every Scan