Automation Direct DL405 User Manual page 311

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

Example 4
Continued
V1500
=
Convert the BCD data to binary. Since the value can never be above
BIN
4095, only the least significant 12 bits of the accumulator are used.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mask off the upper four bits of the word, just in case the data value is out
ANDD
of range (greater than 4095).
KFFF
Earlier in the program the channel selection portion of the data word
OR
was created and stored in V1501. Now we can OR this location with
V1501
the data word currently in the accumulator to get the final data word
that is ready to send to the analog module.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V1501
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Set the Output Enable bit, by combining the value of 8000 hex with the
ORD
accumulator value. This sets bit 15 to "1", enabling all channels.
K8000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Send the data stored in the lower half of the accumulator to the analog
OUT
module (the OUT instruction ignores the upper 16 bits of the
V40501
accumulator). The most significant four bits of the analog word contain
the channel selection bits. The remaining 12 bits contain the analog
data.
Increment Channel Index
Increment the channel index value. This allows the logic to cycle
INCB
through all eight channels.
V1500
Reset Channel Index
K8
When channel 8 has been updated, then reset the channel index
LD
memory location to 0 (remember, 0 represents channel 1).
K0
OUT
V1500
F4–08DA–1 8-Ch. Analog Current Output
0
0
0
0
2
3
4
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1
BCD Value converted to binary now in accumulator.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1
+
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 1 1 0 0 1 0 0 1 0 1 0 0 1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 0 1 1 0 0 1 0 0 1 0 1 0 0 1
15–21
5
Data for Analog Module

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?

Table of Contents