13–20
F4–04DA–1 Analog Current Output
Updating all
Channels in a
Single Scan
5
4
4
430
440
450
By using the Immediate instructions found in the DL440 and DL450 CPUs (not
DL430s), you can easily update all four channels in a single scan. Before choosing
this method, remember that it slows the CPU scan time. To minimize this impact,
change the SP1 (Always On) contact to an X, C, etc. permissive contact that only
updates the channels as required. This example assumes you already have the
data loaded in V3001, V3002, V3003, and V3004 for channels 1–4 respectively.
NOTE: This program will not work in a remote/slave arrangement. Use one of the
programs shown that reads one channel per scan.
Channel 1 Example
SP1
The remaining channels are updated with a similar program segment. The only
changes are the location of the data for each channel (V3002, V3003, and V3004)
and the ORD instruction. The constant loaded with the ORD instruction is different
for each channel. The following example shows where these differences occur.
Changes for channels 2 – 4
SP1
V location changes
Constant changes
The LD instruction loads the data for channel 1 into
LD
the accumulator.
V3001
The BIN instruction converts the accumulator data
BIN
to binary (you must omit this step if you've already
converted the data elsewhere).
The ANDD instruction masks off the channel select
ANDD
bits to prevent an accidental channel selection.
KFFF
The ORD instruction (with K4000) sets the Output
ORD
Enable bit. Outputs Y34 and Y35 are left off to select
K4000
channel 1 for updating with the data.
The OUTIF sends 16 bits to the data word. Our
OUTIF
Y20
example starts with Y20, but the actual value depends
K16
on the location of the module in your application.
You have to send 16 bits with the OUTIF instruction. If
you don't send all 16 bits, the module will ignore the
data.
The LD instruction loads the data for channel 2 into
the accumulator.
LD
V3002
Location Channel
V3001
1
V3002
2
V3003
3
V3004
4
The BIN instruction converts the accumulator data
BIN
to binary (you must omit this step if you've already
converted the data elsewhere).
Mask off the upper four bits, so bad data cannot
ANDD
corrupt the channel select bits, output enable bit,
KFFF
or sign bit.
The ORD instruction with the constants as specified
ORD
selects the appropriate channel to be updated, and
K5000
sets the Output Enable bit. The following constants are
used.
OUTIF
Y20
Constant Channel
K16
K 4000
1
K 5000
2
K 6000
3
K 7000
4
Need help?
Do you have a question about the DL405 and is the answer not in the manual?
Questions and answers