Automation Direct DL405 User Manual page 393

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

19–18
F4–08DA–2 8-Ch. Analog Voltage Output
Sequencing
Example 3,
D4–440/450
5
4
4
430
440
450
The following program example shows how to send digital values to the module
when you have more than one channel. This example works only for D4–440 and
D4–450 CPUs. It assumes you are using the following data locations.
V-Memory Locations for Output Data in Example 3
Channel Number
1
V-Memory Storage
3000
The channel index is stored in V1500. It varies from 0 to 7, pointing to channels as
shown:
0 – Ch. 1, 1 – Ch. 2, and 7 – Ch. 8. This example assumes V1500 is
initialized to "0" earlier in the program.
This example program updates one channel during each scan. The program
comments for this portion also shows the accumulator status at each step. The last
portion of the program increments the channel index number and resets it after
eight scans.
Update Channels
SP1
LD
V1500
Always On
LDX
V3000
BIN
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
ANDD
KFFF
2
3
4
3001
3002
3003
This loads the number of the channel to be updated into the
accumulator. The channels are 1–8, but the values in V1500 range
from 0–7 and correspond to the channels. We'll use channel 2 as an
example.
0
0
0
0
0
0
0
0
Acc.
Use the channel selection value, which is now on the data stack, as an
offset from V3000 to load the channel data into the accumulator.
HEX Value in 1st
stack location
Octal
3
0
0
0
0
1
V
=
V
+
Acc. 0
0
0
0
Convert the BCD data to binary. Since the value can never be above
4095, only the 12 least significant bits of the accumulator are used.
0
0
0
0
2
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.
Mask off the upper four bits of the word, just in case the data value is out
of range (greater than 4095).
5
6
7
3004
3005
3006
3007
V1500
0
0
0
1
Octal
3
0
0
1
The value in V3001 is
2345, which is slightly
2
3
4
5
over half scale.
3
4
5
8

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