Automation Direct DL405 User Manual page 420

Analog
Hide thumbs Also See for DL405:
Table of Contents

Advertisement

Example 3
Channels 9 to 16
Continued
SP1
Always On
V1500
LD
V1500
LDX
V3010
BIN
ANDD
KFFF
LD
V1500
SHFL
K12
ORD
K8000
ADDBS
OUTF
Y40
K16
Increment Channel Index
INCB
V1500
Reset Channel Index
K8
LD
=
K0
OUT
V1500
F4–16DA–2 16-Ch. Analog Voltage Output
This loads the number of the channel to be updated into the
accumulator. The channels are 9–16, but the values in V1500 range
from 0–7 and correspond to the channels. We'll use channel 10 as an
example.
Use the channel selection value, which is now on the data stack, as an
offset from V3010 to load the channel data into the accumulator.
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.
Mask off the upper four bits of the word, just in case the data value is out
of range (greater than 4095).
Load the number of the channel to be updated back into the
accumulator again (the channel data is moved to the first data
stack location).
This instruction moves the channel select bit(s) into the proper location.
We'll use it later when we send the 16-bit data word to the module.
Set the Output Enable bit, by combining the value of 8000 hex with the
accumulator value. This sets bit 15 to "1", enabling channels 9 through
16.
Earlier in the program the data value was placed into the first data
stack location. The ADDBS instruction adds the value currently in the
accumulator with the value in the first data stack location.
Send the lower 16 bits stored in the accumulator to the analog module.
The lowest 12 bits contain the analog data. Bits 12, 13, and 14 are the
channel selection bits. Bit 15 is the Output Enable bit. This example
uses Y40, but the actual value depends on the location of the modules
in your application.
Increment the channel index value. This allows the logic to cycle
through all sixteen channels (8 pairs).
When channels 8 and 16 have been updated, then reset the channel
selection memory location to 0 (remember, 0 represents channel 1 and
channel 9).
20–21

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