Single Channel
Since you do not have to determine which channel is selected, the single channel
Selected
program is even more simple.
4
4
4
430
440
450
Reading Values,
The following program example shows how to read the analog data into V-memory
DL440/450
locations with DL440 and DL450 CPUs. Once the data is in V-memory, you can
5
4
4
perform math on the data, compare the data against preset values, and so forth.
This example will read one channel per scan, so it will take eight scans to read all
430
440
450
eight channels.
SP1
LD or LDF
BCD
OUT
V3000
Note: This example uses SP1, which is always on. You
could also use an X, C, etc. permissive contact.
* Remember, before the BCD instruction is executed, the DL430 requires an additional
instruction to mask out the first four bits that are brought in with the LD instruction. An example
of how to do this using an ANDD instruction is shown in the previous section.
SP1
LDF
X20
K12
BCD
LDF
X34
K3
OUTX
V3000
Note: This example uses
SP1, which is always on.
You could also use an X, C,
etc. permissive contact.
F4–08AD 8-Channel Analog Input
When X34 is on, channel 1 data is being sent to the CPU. Use the
LD instruction when using a DL430 CPU.*
The BCD instruction converts the data from binary to BCD.
You can leave out this instruction if your application does not
require it.
The OUT instruction stores the data in V3000.
Loads the first 12 bits of channel data (starting with location X20) from
the module into the accumulator.
Converts the binary value in the accumulator to BCD and stores the
result in the accumulator. Use this BCD conversion if you want the
channel data to be stored as BCD. Do not use this instruction if you
are going to send the data to an internal PID loop because the PID
loop requires the PV (process variable) to be in binary format.
Loads the binary value of the three channel indicator bits, plus the
MSB, into the accumulator and pushes the channel data loaded into
the accumulator from the first LDF instruction into the first level of
the stack. X34 = X20 + 14.
OUTX copies the 16 bit value from the first level of the accumulator stack
to a source address offset by the value in the accumulator. In this case
it adds the above binary value (which is the offset) to V3000. The particu-
lar channel data is then stored in its respective location: For example,
if the binary value of the channel select bits is 0, then channel 1 data is
stored in V-memory location V3000 (V3000 + 0) and if the binary value
is 6, then the channel 7 data is stored in location V3006 (V3000 + 6). See
the following table.
Module Reading
Acc. Bits
Channel 1
000
Channel 2
001
Channel 3
010
Channel 4
011
Channel 5
100
Channel 6
101
Channel 7
110
Channel 8
111
5–15
Offset
Data Stored in ...
0
V3000
1
V3001
2
V3002
3
V3003
4
V3004
5
V3005
6
V3006
7
V3007
Need help?
Do you have a question about the DL405 and is the answer not in the manual?