Automation Direct DL405 User Manual page 340

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

16–26
F4–16DA–1 16-Ch. Analog Current Output
The second portion of the FOR–NEXT loop updates channels 9 through 16.
Update Channels 9 - 16
SP1
Now we increment the Immediate Analog Output Pointers for the next pair of
channels, before the next pass through the FOR-NEXT loop.
Increment Immediate Analog Output Pointers
SP1
Here is the end of the FOR-NEXT loop.
The program above can be modified to immediately output any number of channel
pairs by changing the constant in the FOR instruction.
Load the analog output value into the accumulator.
LD
V3010 = Ch. 9, V3011 = Ch. 10, ... V3017 = Ch. 16.
P1403
The number at V1403 is a pointer to the address of
the value.
Convert the data to binary. This step is optional,
BIN
and your program may do this conversion
elsewhere.
Mask off the channel select and output enable bits, so
ANDD
they are not corrupted by data out of range.
KFFF
Combine the channel select and output enable bits. for
OR
Y56, Y55, and Y54 with the data in the accumulator.
V1401
Immediately write the lower 16 bits of the accumulator
OUTIF
Y40
to the module's upper data word. This updates
K16
channels 9 through 16 during the FOR–NEXT loop.
This example uses Y40, but the actual value depends
on the location of the modules in your application.
Increment the analog output data pointer for channels 1
INCB
through 8.
V1402
Increment the analog output data pointer for channels 9
INCB
through 16.
V1403
Load the current channel index count into the
LD
accumulator.
V1401
Add 1000 hex to the channel index value, since
ADDB
the channel select field is in the most significant
K1000
four bits.
Save the incremented channel index value for the next
OUT
pass through the FOR–NEXT loop.
V1401
Execute the loop above the number of times speci-
NEXT
fied in the FOR instruction.

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