Automation Direct DL405 User Manual page 163

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

8–14
F4–08THM–n 8-Channel Thermocouple Input
Single Channel
Selected
4
4
4
430
440
450
Reading Values,
DL440/450
5
4
4
430
440
450
Since you do not have to determine which channel is selected, the single channel
program is even more simple.
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.
The following program example shows how to read the analog data into V-memory
locations with DL440 and DL450 CPUs. Once the data is in V-memory, you can
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
eight channels.
SP1
LDF
K12
BCD
LDF
K3
OUTX
V3000
Note: This example uses
SP1, which is always on.
You could also use an X, C,
etc. permissive contact.
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
X20
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 into the
X34
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
Channel 1
Channel 2
Channel 3
Channel 4
Channel 5
Channel 6
Channel 7
Channel 8
Acc. Bits
Offset
Data Stored in ...
000
0
V3000
001
1
V3001
010
2
V3002
011
3
V3003
100
4
V3004
101
5
V3005
110
6
V3006
111
7
V3007

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DL405 and is the answer not in the manual?

Questions and answers

Table of Contents