Rockwell Automation SA3100 Distributed Power System Drv Config,Program User Manual

Page 89

Advertising
background image

Configuring the UDC Module’s Registers

3-51

to respond to an interrupt from the UDC module. Registers within this range that are
written to by an AutoMax task are read by the UDC operating system from dual port
memory and copied into the UDC local memory at the beginning of the Nth scan. See
figure 3.2.

The following data types can be defined in the application register area: boolean (bit),
integer (16 bits), double integer (32 bits), and real (32 bits). Because of the way in
which read and write operations occur in the UDC dual port memory, however, the
programmer must assign boolean variables carefully within pairs of 16-bit registers.

The UDC operating system generally operates on the amount of memory called for by
the data type, e.g., when it is requested to write to a 16-bit (integer) value, it writes
only to those specific 16 bits. However, in the case of boolean variables, the UDC
operating system always operates on 32 bits at a time. It is not possible for the
operating system to write to only one bit within a register. The remaining 31 bits in the
register pair will be written over as well, possibly resulting in corrupted data.

Within any pair of 16-bit registers beginning on an even number boundary, i.e.,
registers 300 and 301, 302 and 303 (but not registers 301 and 302), all boolean
variables must be either inputs or outputs. If there are no bits assigned within a
particular register pair, then one 16-bit register can be an output and the other 16-bit
register can be an input, or both can be inputs or outputs. Alternatively, the entire
register pair can be defined as a real or double integer value.

Note that if you are referencing a 32-bit value (real or double integer) in the UDC dual
port from an AutoMax task, the operation is being performed by the AutoMax
Processor, which operates on 16 bits of data at a time. In such a situation, you must
employ some form of software handshaking in the AutoMax task to ensure that both
the upper and lower order 16 bits represent the current value of the variable. This is
required for 32-bit values in the “every” scan register range. The handshaking can be
done by using software “flags” to indicate that data can be read. It is also possible to
read the data multiple times (typically three times) and compare the values.

!

ATTENTION: If you use double integer variables, you must implement a
software handshake between the transmitter and the receiver to ensure
that both the least significant and the most significant 16 bits have been
transmitted before they are read by the receiving application program.
Failure to observe this precaution could result in bodily injury or damage
to equipment.

Advertising