Rockwell Automation SB3000 Configuration and Programming User Manual

Page 67

Advertising
background image

Configuring the UDC Module’s Registers

3-49

The registers within this range (1300-1599) that are written to by a UDC task are
updated by the UDC operating system from its local memory to dual port memory at
the end of the scan that occurs before the Nth scan (N-1). At that time, an interrupt will
be generated by the UDC operating system to indicate that new data has been written
to the dual port memory. Refer to the 2000-series registers for more information on
interrupts. An AutoMax task must have defined a hardware EVENT in order to be able
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. It is possible to use
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.

Advertising