352
SECTION
3
PLC
Programming
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
CHAPTER
9
Programming
Languages
EXAMPLE 9-11
A batching system operates during an eight-hour shift, where several
batch sizes are processed at the rate of approximately one batch per
hour. Implement instructions to store the batch information, including
the batch size in gallons and the time of day when the batch was
finished. Register 1000 holds the value of the total batch, while register
1500 holds the time of day (in hours and minutes) in BCD format
(HHMM).
S
OLUTION
Figure 9-103 illustrates a register-to-table instruction that will transfer
the outputs of registers 1000 and 1500, using the same pointer register
to store the information to two tables simultaneously. This ensures that
the pointer points to a batch amount that corresponds to the time of the
batch (see Figure 9-104). The Batch Done signal, perhaps coming
from the opening of the discharge valve, triggers the register-to-table
instruction. Once the storing of the register into the table has taken
place, the instruction’s enable/done output increments the pointer.
The pointer is incremented in only one of the blocks to avoid a double
The transition of the control input from OFF to ON enables a table move
instruction, which then increments the contents of the pointer register every
time the middle input, the increment (INCR) pointer, transitions from OFF to
ON. The bottom input of the table move block resets the pointer to zero
(initialize to top of table). If data must be stored to or retrieved from a specific
table location, the pointer register can be loaded with the appropriate value,
which points to the specified location. A set parameter or move register
instruction loads this information prior to the table move.
Referencing Figure 9-102, the length specifies the number of word locations
in the table to be moved (8 in this example), beginning at the starting location
(register 2000). After the table move block transfers the data from these eight
locations, it energizes the top output. It energizes the middle output when the
pointer register has reached the end of the table.
Applications of the table move instruction include the loading of new data
into a table, the storage of input information (e.g., analog) from special
modules, and the input of error information from a controlled process. It is
also useful when changing preset parameters in timers and counters and
when simultaneously driving a group of 16 outputs through I/O registers. A
table move instruction is also used when looking up values in a table for
comparison, linear interpolation, etc.