15–20
F4–08DA–1 8-Ch. Analog Current Output
Sequencing
Example 4,
DL430
4
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 for DL430, DL440 or
DL450 CPUs. It assumes you are using the following data locations.
V-Memory Locations for Output Data in Example 4
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.
The first portion of the program updates one channel during each scan. The
program comments show the accumulator status at each step. The last portion of
the program increments the channel index number and resets it after eight scans.
Channels 1 to 8
SP1
LD
V1500
Always On
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
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
SHFL
K12
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
OUT
V1501
LD
V1500
LDX
V3000
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.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
This instruction moves the channel
selection bit(s) into the proper location.
We'll use it later when we send the 16-bit
data word to the module.
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
Store the channel selection portion of the data word in V1501
temporarily. We'll have to use it again later.
Load the channel selection from V1500 once again.
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
V
3
0
0
0
0
1
=
V
+
Acc. 0
0
0
0
5
6
7
3004
3005
3006
3007
V1500
0
0
0
1
V1500 in accumulator
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.
8
Need help?
Do you have a question about the DL405 and is the answer not in the manual?
Questions and answers