Reading Values, Dl440/450 - Automation Direct DL405 User Manual

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

10–16
F4-08THM 8-Channel Thermocouple Input
Reading Values,
DL440/450
5
4
4
430
440
450
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. Contact SP1 is used in the example because the inputs are
continually being updated. This example will not work with DL430 CPUs.
SP1
LDF
K16
LDF
K3
OUTX
V3000
Note: This example uses
SP1, which is always on.
You could also use an X, C,
etc. permissive contact.
Loads the 16 bits of channel data (starting with location X0) from the
X0
module into the accumulator.
Loads the binary value of the active channel bits (0–7) into the
X20
accumulator, and pushes the channel data loaded into the
accumulator from the first LDF instruction onto the first level of the
stack.
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 (0–7, which is the offset) to V3000.
The particular 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 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