beautypg.com

Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 93

background image

Chapter 5
Ladder Program Basics

5–9

Application Example

Use the following program to achieve the maintained contact action of an
On–Off toggle switch using a momentary contact push button. (Press for
On; press again for Off.)

The first time you press the push button (represented by address I:0/1),
instruction B3/11 is latched, energizing output O:0/2. The second time you
press the push button, instruction B3/12 unlatches instruction B3/11,
de–energizing output O:0/2. Instruction B3/10 prevents interaction between
instructions B3/12 and B3/11.

Status Bit

I:0/1

Rung

B3/10

B3/12

O:0/2

B3/11

1

2

3

4

]/[

B3

10

1

] [

I:0.0

1

( )

B3

11

( )

B3

12

2

] [

B3

11

]/[

B3

12

]/[

B3

10

( )

2

( )

B3

10

] [

I:0.0

1

] [

B3

11

3

4

] [

B3

11

] [

I:0.0

1

] [

] [

] [

( )

]/[

]/[

( )

] [

] [

] [

( )

( )

]/[

O:0.0

As previously indicated, the processor executes instructions individually,
rung by rung, from the beginning to the end of the program. This is called a
program scan and it is repeated many times a second. The figure on the next
page indicates in greater detail what happens during individual scans when
an external input device (represented by I:0/1) is operated.