Automation Direct DL405 User Manual page 418

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

Sequencing
The following program example shows how to send digital values to the module
Example 3,
when you have more than one channel. This example works only for D4–440 and
D4–440/450
D4–450 CPUs. It assumes you are using the following data locations.
5
4
4
430
440
450
Channel Number
V-Memory Storage
Channel Number
V-Memory Storage
The channel index is stored in V1500. It varies from 0 to 7, pointing to pairs of
channels as shown: 0 = ch. 1 and 9, 1 = ch. 2 and 10, ... and 7 = ch. 8 and16. This
example assumes V1500 is initialized to "0" earlier in the program.
The first portion of the program updates one channel from the first bank of eight
channels (1 to 8) during each scan. The program comments for this portion also
shows the accumulator status at each step. The second part of the program
updates one channel from the second bank of eight channels (9 to 16) during each
scan (accumulator status not shown). So, there are two channels which are
updated on each scan. The last portion of the program increments the channel
index number and resets it after eight scans.
V-Memory Locations for Output Data in Example 3
1
3000
9
3010
Channels 1 to 8
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
F4–16DA–2 16-Ch. Analog Voltage Output
2
3
4
3001
3002
3003
3004
10
11
12
3011
3012
3013
3014
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
1
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).
20–19
5
6
7
3005
3006
3007
13
14
15
16
3015
3016
3017
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

Subscribe to Our Youtube Channel

Table of Contents