Rockwell Automation 1772-L8_LW_LWP_LX_LXP,D17726.5.8 User Manual User Manual

Page 25

Advertising
background image

Fundamentals of a

Programmable Controller

Chapter 2

2-11

Next, the processor scans the program. It does this statement by statement.
Each statement is scanned in this way:

1.

For each input instruction, the processor checks, or “reads,” the
image table to see if the condition has been met.

2.

If the set of conditions has been met, the CPU writes a 1 into the bit
location in the output image table corresponding to the output
terminal to be energized. On the other hand, if the set of conditions
has not been met, the processor writes a 0 into the bit location,
indicating that the output terminal should not be energized.

Here is a simple explanation of the program. If input 02 is on, then turn on
output 02. If input 02 is off, then turn off output 02. The program could
be written this way:

If (condition)

Then (action)

Input bit 02 is on

Turn output bit 02 on

In this example, the processor reads a 1 at input bit location 02 and knows
that the condition has been met. The processor then carries out the action
instruction by writing a 1 into output bit location 02.

If there were more statements in the program, the processor would
continue in this same manner scanning each statement and executing each
instruction until it reached the end of the program. Statement by
statement, the processor would write a 0 or a 1 into an output bit as
directed by the program. Then, the processor would read specific image
table bits to see if the proper set of conditions were met. After reading and
executing all program statements, the processor scans the output image
table and energizes or de-energizes output terminals. The processor then
goes to the input modules to update the input image table.

Now the entire process is repeated. In fact, it’s repeated over and over
again, many times a minute. Each time, the processor sets or resets output
bits. Next, the processor senses the status of the input terminals. Finally,
the processor scans the program and orders each output terminal on or off
according to the state of its corresponding bit in the output image table.

When forcing is attempted, the processor’s I/O scan slows down to do the
forcing (see chapter 19). When forcing is terminated, the processor
automatically switches back to the faster I/O scan mode.

When this example begins, the processor is energizing output terminal 02
because output bit 02 is on.

When the part is conveyed to the work station, it turns the limit switch off.
When the limit switch is off, there is no voltage at input terminal 02. The
processor scans the input image table, senses no voltage, and responds by
writing a zero into bit 02 in the input image table.

Advertising