Rockwell Automation 1772-LV Mini-PLC - 2/15 Programmable Controller (Series B) Programming and Operations User Manual

Page 18

Advertising
background image

An Introduction to Programmable

Controllers

Chapter 2

2Ć11

Our program could been written this way

If

(Condition)

Then

(Action)

Input bit 02 is off

Turn output bit 02 on

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

If there were more statements in the program, the CPU would continue in the
same manner scanning each statement and executing each instruction until it
reached the end of the program. Statement by statement, the CPU would first
read specific image table bits to see if the proper set of conditions were met.
Then, the CPU would respond by writing a 0 or a 1 into an output bit as directed
by the program. After reading and executing all program statements, the CPU
scan the output image table and energizes or de-energizes output terminals. The
CPU 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,
thousands of times a minute. Each time, the CPU starts by sensing the status of
the input terminals during the input image table scan. if an input device has
changed states since the last scan, the CPU will change the state of the
corresponding bit to reflect the new state. Next, the CPU scans the program and
sets or resets output bits. Finally, the CPU scans the output image table and
orders each output terminal on or off according to the state of its corresponding
bit in the output image table.

When our example begins the CPU is energizing output terminal 02 because
output bit 02 is on.

When the part is conveyed to the work station, it trips the limit switch. The
closed limit switch applies a voltage to input terminal 02. The CPU scans the
input image table, senses this voltage, and responds by writing a 1 (on) into bit
02 in the input image.

The CPU then scans our program. Our program states that “if (condition) input
bit 02 is off, then (action) turn output 02 on.” The CPU examines input image
table bit 02 and discovers that input bit 02 is on. Since the condition is not true,
the CPU writes a 0 (off) into output image table bit 02.

Finally, when the CPU next scans the output image table, it sees the zero in
output bit 02 and responds by de-energizing output terminal 02. The conveyor
will stop after the part closes the limit switch.

Advertising