0% found this document useful (0 votes)
133 views71 pages

Sequential Applications Teoría

Hidraulica

Uploaded by

Israel Cruz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views71 pages

Sequential Applications Teoría

Hidraulica

Uploaded by

Israel Cruz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

6 Sequential Applications

Chapter Topics:

• Function charts

• Simple ladder logic implementation of function charts

• Parallel operations

OBJECTJVES

Upon completion of this chapter, you will be able to:

• Draw a function chart, given the operational description of a sequential process

• Translate the function chart to ladder logic

• Handle pause and reset of the sequential operation

Scenario: Using a proximity sensor to detect material moving into and out of a station.

Commonly, only one sensor is used to detect the presence of material as it moves into a

station, is processed, and moves out ofthe station. A s a n example, consider the problem of

applying a label to each box as it travels on a conveyor, shown in Figure 6. 1 . A

retro-reflective proximity sensor (PROX) is used to detect the presence ofthe box. Assume

PROX tums on when the box is in the proper position to have the label applied. When the

labeling station is started, the presence of a box must be detected, the label is applied

(involving multiple steps ), and then the operation is repeated. A chart of the steps of this

process is shown in Figure 6 . 2. The process starts waiting for a box to be detected. When

PROX tums on, then the machinery applies the ]abe! (multiple steps). When the labeling

steps are finished, then the station waits for the next box. However, as depicted in Figure

6.2, the operation does not work! After applying the !abe!, PROX remains on, (box still in

Reflector

Figure 6.1. Labeling station.

295
296 Sequential Applications

Start
Start

Wait for Wait for

Box to Arrive Box to Arrive

PROXon PROX on

Steps to Steps to

apply label apply label

(conveyor (conveyor

stopped) stopped)

Labeler done Labeler done

Wait for

Figure 6.2. Chart of labeling station Box to Leave

operation.

PROX off

Figure 6.3. Corrected chart of labeling

station operation.

station) and so the condition that indicates a new box (PROX on) is true. Therefore, a new

!abe! is applied to the box before it leaves the station. If left to run unattended, this station

will continue to apply multiple labels to the first box that enters the station!

Solution: The station must detect that a labeled box has exited the station before detecting

that a new box has entered. Therefore, a step must be added to wait for the box to leave the

station, detecting PROX is off. The correct chart ofthis process is shown in Figure 6 . 3 . The

moral ofthis scenario is to remember that one must detect that a proximity sensor is first off

before it can be detected to be on.

Design Tip

When one proximity sensor is used to sense material moving in/out, one must

detect that the sensor is off before detecting the sensor is on (or vice versa).

6.1 INTRODUCTION

With the basic ladder logic contact, timer, and counter instructions, one is able to tackle

more significant problems. This chapter introduces ladder logic program design for
6.2 FUNCTION CHART 297

sequential applications, a significant contribution ofthe text. More advanced techniques for

sequential control are treated in Chapter 9.

The sequential design technique is based on describing the operation as a function chart

and then translating the function chart to ladder logic code. The ladder logic primarily uses

the basic contact and coi! instructions. Timers and counters are used only when explicitly

needed by the operation. The ability to pause and reset an operation is added to the basic

sequential design. Operations with parallel steps and machine control involving manual and

single-step modes are also considered. Since the design technique uses the set/reset

instructions, the last section presents an altemate implementation using only the ordinary

output coi! that may be used for PLCs that do not have the set/reset coi! instructions.

6.2 FUNCTION CHART

The basic too! used to design sequential control applications is the function chart. This

method of describing sequential operations is described in the IEC 848 standard (IEC,

1 9 8 8 ) and incorporated as one ofthe IEC 6 1 1 3 1 - 3 languages (IEC, 1 9 9 3 ) . The form ofthe

function chart described in this chapter is a simplified version of the IEC 6 1 1 3 1 - 3 SFC

(sequential function chart) language. The full IEC sequential function chart language is

described in Chapter 1 4 .

The general form of the function chart is shown in Figure 6.4. The function chart has

the following major parts:

Steps of the sequen tia! operation,

Transition conditions to move to next step

Actions of each step

The initial step is indicated by the double-line rectangle. The initial step is the initial

state of the ladder logic when the PLC is first powered up or when the operator resets the

operation. The steps ofthe operation are shown as rectangles on the left side ofthe diagram.

Unless shown by an arrow, the progression ofthe steps proceeds from top to bottom. Each

step rectangle contains a short description ofwhat is happening during the step. To the left

ofthe step rectangle is the variable/symbol/tag name ofthe step-in-progress coi! (or bit) that

is on when that step is active. The transition condition is shown as a horizontal bar

between steps. If a step is active and the transition condition below that step becomes true,

the step becomes inactive, and the next step becomes active. The stepwise flow continues

until the bottom ofthe diagram. At the bottom, the sequencing may end, as indicated by a

filled black circle within another circle, or it may repeat by going back to the first step. The

actions associated with a step are shown in the rectangle to the right ofthe step. The actions

are output(s) that are on when a step is active. Any outputs not listed are assumed to be off.

However, the set/reset of outputs may be indicated. Any timer or counter active during a

particular step is also listed as an action.

The function chart is prepared from the operational description of the system. Often,

the hardest part about formulating the function chart is making a distinction between the

transitions and the steps. Also, one must remember that physical outputs are actions

associated with a step. In order to help in the recognition ofthe steps and transitions within

an operational description, use the following definitions:


298 Sequential Applications

Initial

(ifrepeats) Run (First_Start)

Step 1 Actions (active outputs,


Step_l
Description. timers, counters)

Transition Condition

Step 2 Actions (active outputs,


Step_2
Description. timers, counters)

Transition Condition

Step 5 Actions (active outputs,


Step_S
Description. timers, counters)

Transition Condition

Other steps

� (Final) Transition Condition

Stop @

Steps and Actions

Transitions

Figure 6.4. General function chart.

Step:

Operation spanning a length of time (however long or short).

The time period may be defined or undefined.

Transition:

Physical input device or interna! coi! turning on or off

-or-

Physical input device or interna! coi! being turned on or off

A transition condition is recognized when the narrative describes a physical input

device or interna! coi! tuming on or off. Alternatively, the end of a defined time period also
6.2 FUNCTION CHART 299

signals a transition to the next step. Ifthe narrative describes a physical output being tumed

on/off, that is n o t a transition. A physical output is considered a step action and the tuming

on/off of a physical output is handled by a change in the active step. For example, if

"Outputl" is being tumed on as the active step is changed from "Step l " to "Step2," it is

accomplished by not listing "Outputl" as a "Stepl" action and by listing i t a s a "Step2"

action. Outputl is n o t a transition condition. The change in Outputl <loes not cause a change

in the active step, but is a consequence of the change in the active step.

Design Tip

When constructing the function chart, remember that physical outputs never

occur as part ofthe transition condition. Also, physical inputs are never an action.

These concepts are illustrated by the following example.

Example 6.1. Metal Shear Control. Design the function chart ofthe program to control the

metal shear shown in Figure 6.5 and whose operation is described as:

The shear cuts a continuous length of steel strip. Two conveyors (driven by

CONVl_MTR and CONV2_MTR) move the strip into position. Inductive

proximity sensor PROX tums on to indicate that the strip is in position to be

sheared. When the strip is in position, both conveyors should stop. A hydraulic

cylinder (controlled by SHEAR_CYL_RET) is then retracted to move the shear

down to cut the material. Limit switch DOWN_LS closes (tums on) when the

shear is fully down. The cylinder is then extended to move the shear blade up.

Limit switch UP _LS closes when the shear blade is fully up. Conveyor 2

(controlled by CONV2_MTR) is now tumed on to move the cut sheet out ofthe

station. The proximity sensor PROX tums off when the sheet has been moved out

ofthe station. Both conveyors are now operated to move the strip into position, and

the operation repeats.

Your program is not controlling conveyor 3, so assume it is always running.

The shear is controlled by SHEAR_CYL_RET, a single action linear

hydraulic cylinder. Once SHEAR_CYL _RET is energized, the shear blade moves

down to cut the material until a mechanical stop is reached and remains in the

"down" position as long as power is applied (tumed on). The shear blade moves up

when power is removed (tumed off).

Upon initial startup, no material is in the shear and the conveyors operate to

bring the material into the shearing position (PROX tums on). The start switch

should have no effect ifthe process is already running. Ifthe stop switch is pressed

at any time, the station operation should pause, except when the shear blade is

moving. If the stop switch is pressed when the shear blade is moving, the blade

movement must complete. When the start switch is pressed while the operation is

paused, the station should resume the suspended step. When the station is paused,

the conveyor drive motors should be shut off.

Assume the following physical input and physical outputs:


300 Sequential Applications

....-

Shear

Cylinder...__.(
PROX
o )
o
..
Conveyor 1 Conveyor 2 Conveyor 3

(a)

Shear

Blade

! Convoyml
Conveyor 2 Conveyor 3

CONVI MTR CONV2 MTR CONV3 MTR

(b)

Shear

Blade

_......._ UP LS

_......._ DN LS

Shear Cylinder

(c)

Figure 6.5. Metal shear: (a) top view; (b) front view; (e) side view.

Variable Description

START PB Start push button, N . O . , on when starting

STOP PB Stop push button, N. C., offwhen stopping

PROX Proximity sensor, on when strip in shearing position

DOWN LS Limit switch, N . O . , on (closed) when blade fully down

UP LS Limit switch, N . O . , on (closed) when blade fully up

CONVl MTR Conveyor 1 control, on to move material on conveyor 1

CONV2 MTR Conveyor 2 control, on to move material on conveyor 2

SHEAR CYL RET Shear cylinder control, on to retract cylinder and move blade

down

Solution. There are two main steps to develop the function chart:

1 . Identify the steps and transition conditions.

2. Add step actions.


6.2 FUNCTION CHART 301

To identify the steps and transitions, the first paragraph of the process description is

repeated, with the steps identified by the underlined phrases and the transition conditions

identified by the italicized phrases. Often, it is easier to identify the first transition condition

(signaled by an input sensor change) and then recognize the step befo re and the step after the

transition condition. Also, many times the steps and transition conditions altemate during

the narrative.

The shear cuts a continuous length of steel strip. Two conveyors (driven by

CONVl_MTR and CONV2_MTR) move the strip into position. Inductive

proximity sensor PROX turns on to indicate that the strip is in position to be

sheared. When the strip is in position, both conveyors should stop. A hydraulic

cylinder ( controlled by SHEAR_CYL_RET) is then retracted to move the shear

down to cut the material. Limit switchDOWN_LS clases (turns on) when the shear

is fully down. The cylinder is then extended to move the shear blade up. Limit

switch UP_LS clases when the shear blade is fully up. Conveyor 2 ( controlled by

CONV2_MTR) is now tumed on to move the cut sheet out of the station. The

proximity sensor PROX turns ojfwhen the sheet has been moved out ofthe station.

Both conveyors are now be operated to move the strip into position, and the

operation repeats.

Notice that the phrase " . . . both conveyors should stop." is not marked as a transition

condition. This phrase describes a physical output being tumed on/off and that will be

handled by a change in the active step.

So, the steps and the transition conditions that indicate the end of each step are:

Step Transition Condition ( out of step)

Move strip into position PROX on

Move shear down DOWN LSon

Move shear up UP LS on

Move cut sheet out PROX off

These steps and the transition conditions between them are shown in Figure 6. 6. The

"off' state of PROX that signals the end ofthe fourth step is shown with the "/" in front of

the variable name. The variable name ofthe step-in-progress bit for each step is also shown

beside the step box. This particular operation repeats, indicated by the line from the fourth

step back to the first step.

The next part of the function chart development is to add the actions to each step.

Reading back through the metal shear narrative, the process actions for each step are:

Step Action

Move strip into position CONV 1 MTR and CONV2 MTR


- -

Move shear down SHEAR CYL RET

Move shear up

Move cut sheet out CONV2 MTR

These actions are added to the steps and the transition conditions to form the function

chart shown in Figure 6. 7.

The part ofthe narrative that describes the operation pause is handled in the ladder logic

code and is considered in the following section.


302 Sequential Applications

Initial

Run (First_Start)

Step_l

PROX

Move Shear
Step_2
Down

DOWN LS

Move Shear
Step_3
Up

UP LS

Move cut
Step_4
sheet out

/PROX

Figure 6.6. Steps and transitions for metal shear.

Initial

Run (First_ Start)

Move In CONVI MTR


Step_l
Material CONV2 MTR

PROX

Move Shear SHEAR_CYL_RET


Step_2
Down

DOWN LS

Move Shear
Step_3
Up

UP LS

Move cut CONV2 MTR


Step_4
sheet out

/PROX

Figure 6.7. Function chart for metal shear.


6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 303

6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC

Once a function chart has been developed, it needs to be implemented in ladder logic.

There are multiple ways to accomplish this task. The design technique described in this

chapter utilizes only the basic ladder logic instructions to implement the step and transition

logic. Other methods are shown in Chapter 9.

The author calls this method the "cookie cutter" or "template-based" approach because

the form of the ladder logic code is the same, regardless of the application. Also, this

approach aids in debugging because the logic that handles the transitions and the logic that

handles the step actions are distinct. The latter advantage is apparent when comparing this

approach to the ad-hoc approach of section 9 . 5 .

The code is broken into the following sections:

Start/stop/pause of overall operation

First start

Transitions between steps

Step actions

Each ofthese code templates is covered in detail and then applied to the metal shear of

Example 6 . 1 . •

The start/stop/pause ofthe overall operation is handled as the rung in Figure 6.8, which

is the same general format as the start/stop rung shown in section 2 . 7 . An interna! coil

(variable) named Run controls the overall operation ofthe function chart. lt will be used to

turn off physical outputs that need to be off when pausing the operation. Occasionally, the

Run may be used as part of a transition condition. The optional permissive conditions must

be satisfied to allow the operation to be started or restarted after an abnormal condition. The

optional lockout conditions cause the operation to pause or stop in addition to preventing a

restart.

The "first start" transition condition causes the operation to be initiated when no steps

are currently active. The ladder logic to generate First_Start is shown in Figure 6.9a. When

the Run interna! coi! is tumed on (start push button pressed) and no steps are active (Step_N

is the last step), the First_Start interna! coi! is tumed on and will be used as a transition

condition into the first step. Altematively, the first step (Step _ 1 ) can be set (latched) to start

the operation (Figure 6.9b). START_pB could be used in place ofRun in Figure 6.9, but if

the run rung has permissive and/or lockout conditions, these conditions should also be

repeated on the rung that starts the operation for the first time. As explained in section 2. 7, a

change to lockouts and permissives should affect only one rung.

Transitions between steps are handled as shown in Figure 6 . 1 O. The logic implements

the transition condition below the step in the function chart, which is the transition condition

- - - - - - - - - -
START PB . .
STOP PB Run

: Permis- : : Lock- :

l (
si ves : outs :

Run

Figure 6.8. General start/stop/pause rung.


304 Sequential Applications

(a)

Figure 6.9. General first start rung: (a) First_Start interna! coi!; (b) set first step.

out of a step. When the current step is active (Current_Step is on) and the transition

condition is true, then the step-in-progress bit of the next step is set and the

step-in-progress-bit ofthe current step is reset. Thus, the next step becomes active and the

current step becomes inactive.

Ifthe PLC does not have set/reset or latch/unlatch instructions (e.g., Modicon 984 and

Siemens TI-5x5) then an alternative approach must be used, as detailed in section 6.8 .

The step-in-progress interna! coils are used to control the step actions. The appropriate

step-in-progress bits turn on the outputs and timers that are the step actions. The Run

interna! coi! is also used as part ofthe condition for those actions that must be offwhen the

operation is paused. For example, ifthe MOTOR_ON output should be on in steps 4 and 1 5

of the function chart (represented by Step_4 and Step_15), then the logic driving

MOTOR_ ON appears as shown in Figure 6.11. The Run interna! coi! tums off

MOTOR_ON if step 4 or step 1 5 is active and the stop push button is pressed to pause the

operation. When the operation is resumed (by pressing the start push button), then

MOTOR_ ON is reactivated. If the Run interna! coi! is omitted from the rung in Figure 6 . 1 1 ,

then MOTOR_ ON will remain on when the operation is paused when in step 4 or step 1 5 .

Transition_Condition Next_S tep


�ent_Step

1 -1----,--
� � s

1 1
��_Step

81
Figure 6.10. General transition between steps.

Figure 6 . 1 1 . Example step action.


6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 305

Note that in Figure 6 . 1 1 , the Step _4 and Step _ 1 5 step-in-progress bits are in parallel,

meaning that MOTOR_ ON is an action in steps 4 and 1 5 . The MOTOR_ ON output is offfor

any other steps.

If the action associated with a step is a set/reset of an output, then the output coi! of

Figure 6 . 1 1 is replaced by a set or reset coi!.

Design Tip

Repeating outputs is a common mistake when implementing a function chart where

a particular output is the action for more than one step. Consider the output first and

then the steps for which it is on to avoid repeating output instructions.

Example 6.2. Metal Shear Control. Use ladder logic to implement the metal shear operation

described in Example 6 . 1 .

The physical inputs and physical outputs are:

Variable Description

START PB Start push button, N . O . , on when starting

STOP PB Stop push button, N. C., offwhen stopping

PROX Proximity sensor, on when strip in shearing position

DOWN LS Limit switch, N . O . , on (closed) when blade fully down

UP LS Limit switch, N . O . , on (closed) when blade fully up

CONVl MTR Conveyor 1 control, on to move material on conveyor 1

CONV2 MTR Conveyor 2 control, on to move material on conveyor 2

SHEAR CYL RET Shear cylinder control, on to retract cylinder and move blade

down

The addresses associated with the variables:

Variable Modicon PLC-5 Contro!Logix Siemens GEFanuc

START PB 100001 1:0/00 Local: 1 :!.Data.O 10.0 %1 1

STOP PB 100002 1:0/01 Local: 1 :I.Data.1 10.1 %12

PROX 100003 1:0/02 Local: 1 :I.Data.2 10.2 %13

DOWN LS 100004 1:0/03 Local: 1 :I.Data.3 10.3 %14

UP LS 100005 I:0/04 Local: 1 :I.Data.4 10.4 %15

CONVl MTR 000001 0:1/00 Local:2:0.Data.O Q4.0 %Ql

CONV2 MTR 000002 0:1/01 Local:2:0.Data. l Q4. 1 %Q2

SHEAR CYL RET 000003 0:1/02 Local:2:0.Data.2 Q4.2 %Q3

Solution. The function chart for the shear operation is shown in Figure 6.7. Before

developing the ladder logic code, the interna! variables should be identified:

Variable Description

Run lndicates operation running

Step_l to Step-in-progress bits for steps

Step_ 4

The addresses or data types associated with the variables:


306 Sequential Applications

Modicon PLC-5 ControlLogix Siemens GEFanuc

Variable Data Type Addr. Data Type Addr. Addr.

Run BOOL 83/0 BOOL MO.O %MO

Step_l to 800L B20/l 800L M50.l %M51

Step_4 BOOL 820/4 800L M50.4 %M54

The ladder logic code is broken into the following sections:

Start/stop/pause of overall operation

First start

Transitions between steps

Step actions

The IEC 6 1 1 3 1 - 3 code for the metal shear, shown in Figure 6 . 1 2 , is developed using the

code templates shown in Figures 6.8 - 6 . 1 1 . A rung comment is shown within a rectangle

above the rung. The function of each rung is as follows:

1. Start/stop/pause of overall operation

2. First start (starting the operation for the very first time)

3. Transition from step 1 to step 2

4. Transition from step 2 to step 3

5. Transition from step 3 to step 4

6. Transition from step 4 to step 1

7. Control ofconveyor l (an action for step 1 )

8. Control of conveyor 2 (an action for steps l and 4)

9. Control of shear cylinder (an action for step 2)

The initial start ofthe operation is handled like Figure 6.9b. Note the use ofthe Run in

rungs 7 and 8 to tum off the conveyors when the station is paused. Since the shear cylinder

operation should not stop if the stop push button is pressed while it is moving, Run is not

used as a condition in rung 9.

The CONV2_MTR output is an action for 2 steps, as shown in rung 8 ofFigure 6 . 1 2 .

Note that if a particular output is an action for multiple steps, then the step-in-progress bits

of each step are placed in parallel. When a particular output is the action for more than one

step, novice programmers often repeat the outputs. If one did not consider the output first

I Start/stop/pause I

START PB STOP PB Run

tr
I Generate transition out of initial step I

Run Step_l Step_2 Step_3 Step_4 Step_l

2
1-----ld---U�--U�--U-I�--es
Figure 6.12. IEC ladder logic for metal shear. (continued)
6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 307

I Step 1 - Move in material. Trans. to Step 2 when in position. ¡

Step_l PROX Step_2

3
1 1 -
1 -------.--
r.- s

w;-1
�IS
- t
- e
p-2
- -_M_o
_ v
_ e
_ s
- h
e_a
_ r
_ d
- o
w -n
-
.T-r
- a
n_s
_ t
_ o
_ S
_ t
e_p
_ 3
_ w-h
e_n
_ s
_ h
- e
a_r
_ d
_ o
_ w_n
� . ¡

Step_2 DOWN LS Step_3

4
1 1 r- ----�r.- s

w;-2
I Step 3 - Move shear up. Trans. to Step 4 when shear up. ¡

Step_3 UP LS Step_ 4

5 1 1 - -I-----.--
r.- s

w;-3
I Step 4 - Move cut sheet out. Trans. to Step 1 when out. 1

Step_4 PROX Step_l

6
1 1 / 1 -----�r.- s

w;-4
I Conveyor 1 control I

Step_l Run CONVl MTR

7 1----t

1 1

I Conveyor 2 control I

Step_l Run CONV2 MTR

g ,-.... - -, �

Step�

I Shear cylinder control I

Step_2 SHEAR CYL RET

9 1----t

Figure 6.12. (continued)


308 Sequential Applications

and then steps for which it is on then the ladder logic driving the physical outputs for the

shear may appear as in Figure 6 . 1 3 . Rungs 8 and 1 0 both drive the CONV2_MTR output.

What is the result? Since rung 1 0 is scanned after rung 8, the logic ofrung 1 0 will override

the logic of rung 8. Consequently, CONV2 _MTR is-never on in step 1 , causing the material

to jam as it is conveyed into position.

Depending on the particular PLC used to implement this example, the ladder logic will

appear different from the ladder logic shown in Figure 6 . 1 2 . Ifusing Modicon Concept, the

right power rail is absent and a circle encloses the set and reset instructions. The

Allen-Bradley ControlLogix, PLC-5, and SLC-500 use latch/unlatch in place of the

set/reset.

Example 6.2 does not have ali of the features of a real application, but serves to

illustrate the basic approach to implementing a function chart in ladder logic. The next

example adds timers, counters, and reset to an application.

Example 6.3. Tub Loader Control. Design the function chart of the program to control the

tub loader described below. Also, implement the control with ladder logic.

Figure 6 . 1 4 shows the layout of a parts tub loader machine. Parts are placed on

the belt conveyor by a milling machine. The parts move down the conveyor and

drop into the parts tub. Parts on the belt conveyor are detected by a photoelectric

sensor, PE272, which is off as a part interrupts the beam. Assume PE272 detects

the p a rt a s it falls into the tub. After 100 parts are deposited in the tub, the tub is

moved out and a new, empty tub moves into position. To change the tub, the

following operation must take place:

I Conveyor 1 control for step 1 1

Step_l Run CONVl MTR

7 _,---t

I Conveyor 2 control for step 1 1

Step_l Run CONV2 MTR

8 _,---t

I Shear cylinder control for step 2 I

Step_2 SHEAR CYL RET

I Conveyor 2 control for step 4 I

Step_4 Run CONV2 MTR

10 1 1

Figure 6.13. Incorrect output logic for metal shear.


6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 309

.- -------- .

Downhill 1 :! : Inclined Roller

....-"'...:..::·====::::I_¡_:___;Conveyor
1

Empty

GATE2_0PLS GATE2_CLLS Tub

-- --
Gate 2 Cylinder
1

:,---;-c====:r 1,

1 :

Gate2 PE272

TUB_PROX LJ : : : : : : : , . Tub
Milling

GATEI_OPLS GATEI_CLLS
Being
o�o Machine

-- --
Filled

Belt Conveyor
Gate I Cylinder
(BELT_RUN)

Gate 1

Roller Conveyor

:1 (TROLL_RUN)

Figure 6.14. Parts tub loading station.

Open Gate 1 (GATEl_OPLS senses when open).

Hold Gate 1 open and wait for TUB _pROX to be off for 3 seconds to

allow the full tub to be moved out of the loading station. Run the tub

roller conveyor to move out the full tub.

Gate 1 is closed (GA TE l _CLLS senses when closed).

Gate 2 is opened (GATE2 _OPLS senses when open).

Hold Gate 2 open to allow an empty tub to move down a slight incline

into the loading station. When the tub contacts the tub roller

conveyor, the tub roller conveyor moves the tub into position. When

TUB _PROX is on for 5 seconds, the tub is in position (front resting

on Gate 1).

Gate 2 is closed (GATE2_CLLS senses when closed).

The TUB _PROX proxirnity sensor is on when the tub is present, though not

necessarily in position. Hence, the delays ensure the empty tub has moved in and

the ful! one has moved out.

While the tub is being changed, the belt conveyor motor must be stopped

(BELT_RUN off) andan interna! coil, Tub_Permissive, must be tumed off. After

a new tub is in position, BEL T_RUN is tumed on, the Tub _Permissive coil is

tumed on, and the counting ofparts is resumed. The Tub_Permissive is used bythe

milling machine ladder logic. When Tub_Permissive is on, the machine produces

parts.

The roller conveyor for the tubs has two sections. The section between the two

gates and extending out of the station is powered and controlled by the
310 Sequential Applications

TROLL_RUN output. The roller conveyor section before Gate 1 is unpowered and

inclined to allow new tubs to move into the station. In order to completely move

the empty tub into the station, the powered section must be running.

Single-action pneumatic cylinders control Gate 1 and Gate 2. Once

GA TE 1 _RET is energized, gate 1 opens and remains in the open position as long

as power is applied (turned on). The gate closes when power is removed (turned

off). Limit switches GATEI _OPLS and GATE l _CLLS sense the open and closed

positions, respectively. Similarly, GATE2_RET controls Gate 2. The

GATE2_0PLS and GATE2_CLLS limit switches sense the position ofGate 2.

Single-speed motors drive the two conveyors. When BELT _RUN is on, the

conveyor moves parts from the milling machine to the tub. When BEL T_RUN is

off, the conveyor is stopped. When TROLL_RUN is on, the powered section of

the roller conveyor moves. When TROLL_RUN is off, the powered section ofthe

roller conveyor is stopped.

There is an interna! coi!, Run, that is on when the operation is enabled. The

Run interna! coi! is set by another part ofthe ladder logic. When the Run coi! is off,

the tub loading operation should be paused at the current step. When paused, do

not advance to the next step. When the Run coi! turns on while the operation is

paused, the tub loader should resume the suspended step. When paused, both

conveyors must be stopped, ali counter and timer accumulator values must be

retained, and the ladder logic program must remain in the step in which the Run

coi! changed from on to off. If the Run coi! turns off when changing tubs, the

pneumatic cylinder controls must continue to be activated, holding the gate open

(otherwise, a tub may be damaged).

There is another interna! coi!, Reset, that when on, restarts the operation. The

Reset interna! coi! is set by another part of the ladder logic. When Reset is on,

internal counters and timers are reset and the interna! state is set so that the ladder

logic program assurnes an empty tub is in position. The Reset interna! coi! must be

ignored while Run is on.

Assume the following physical input, physical output, and interna! coi! assignments:

Variable Description

PE272 Photoelectric sensor, off when part passes.

TUB PROX Proximity sensor, on (closed) when tub is present, though not

necessarily in position to receive parts.

GATEI OPLS Limit switch; on (closed) when Gate 1 is open.

GATEl CLLS Limit switch, on (closed) when Gate 1 is closed.

GATE2 OPLS Limit switch, on (el o sed) when Gate 2 is open.

GATE2 CLLS Limit switch, on (closed) when Gate 2 is closed.

BELT RUN Belt conveyor control, on to run conveyor to move parts from

milling machine to the parts tub.

TROLL RUN Powered roller conveyor control, on to run conveyor to move

parts tub.

GATEl RET Gate 1 cylinder control, on to retract cylinder and open gate; off

closes gate.

GATE2 RET Gate 2 cylinder control, on to retract cylinder and open gate; off

closes gate.
6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 311

Run Interna! coil, on when loading enabled to operate (controlled by

another part of the ladder logic ).

Reset Interna! coil, on to reset tub loader operation (controlled by

another part ofthe ladder logic).

Tub Permissive Interna! coil, on when milling machine is permitted to run

(controlled by this part of the ladder logic ).

The addresses associated with the physical inputs and outputs are:

Variable Modicon PLC-5 ControlLogix Siemens GEFanuc

PE272 100003 1:0/02 Local: 1 :I.Data.2 I0.2 %13

TUB PROX 100004 I:0/03 Local: 1 :I.Data.3 I0.3 %14

GATEl OPLS 100005 l:0/04 Local: 1 :I.Data.4 I0.4 %15

GATEI CLLS 100006 1:0/05 Local: 1 :I.Data.5 I0.5 %16

GATE2 OPLS 100007 l:0/06 Local: 1 :I.Data.6 I0.6 %17

GATE2 CLLS 100008 l:0/07 Local: 1 :I.Data.7 I0.7 %18

BELT RUN 000001 0:1/00 Local:2:0.Data.O Q4.0 %Q l

TROLL RUN 000002 0:1/01 Local:2:0.Data. l Q4.l %Q2

GATEI RET 000003 0:1/02 Local:2:0.Data.2 Q4.2 %Q3

GATE2 RET 000004 0:1/03 Local:2:0.Data.3 Q4.3 %Q4

The addresses/data types associated with the interna! variables are:

Modicon PLC-5 ControlLogix Siemens GEFanuc

Variable Data Type Addr. Data Type Addr. Addr.

Run BOOL B3 / 1 0 0 BOOL M62.0 %M I OO

Reset BOOL B3/101 BOOL M62.l %Ml01

Tub Permissive BOOL B3 / 1 0 2 BOOL M62.2 %Ml02

Solution. This example introduces the following aspects of sequential problems:

Using timers

Using counters

Using Runas part ofthe transition condition

Reset of the operation

As illustrated in Example 6 . 1 , there are two main steps to develop the function chart:

1. Identify the steps and transition conditions.

2. Add step actions.

To identify the steps and transitions, the first paragraph of the process description is

repeated, with the steps identified by the underlined phrases and the transition conditions

identified by the italicized phrases. As in example 6 . 1 , many times it is easier to identify the

first transition condition (signaled by an input sensor change) and then recognize the step

before and the step after the transition condition. Often, the steps and transition conditions

alternate during the narrative.

Figure 6 . 1 4 shows the layout of a parts tub loader machi ne. Parts are placed on

the belt conveyor by a milling machine. The parts move down the conveyor and

drop into the parts tub. Parts on the belt conveyor are detected by a photoelectric

sensor, PE272, which is off as a part interrupts the beam. Assume PE272 detects

the part as it falls into the tub. After 100 parts are deposited in the tub, the tub is
312 Sequential Applications

moved out and a new, empty tub moves into position. To change the tub, the

following operation must take place:

Open Gate 1 (GATEJ_OPLS senses when open).

Hold Gate 1 open and wait for TUB_PROXto be offfor 3 seconds to

allow the full tub to be moved out ofthe loading station. Run the tub

roller conveyor to move out the full tub.

Gate 1 is closed (GATEJ_CLLS senses when closed).

Gate 2 is opened (GATE2_0PLS senses when open).

Hold Gate 2 open to allow an empty tub to move down a slight incline

into the loading station. When the tub contacts the tub roller

conveyor, the tub roller conveyor moves the tub into position. When

TUB_f'ROX is on for 5 seconds, the tub is in position (front resting

on Gate 1 ) .

Gate 2 is closed (GATE2_CLLS senses when closed).

Since the timer accumulator values must be retained when paused, retentive timers

must be used for the time delays. Also, the Run coil must be one of the conditions that

controls the timer.

The sentence, "When paused, do not advance to the next step." normally means that the

interna! Run coil is part ofthe transition condition. However, since retentive timers are used

for the transition out ofthe steps holding the gates open, the Run coil is not needed for these

steps. One could argue that the Run coil is not needed for the transitions out of the other

steps since the conveyors are stopped when paused, but for the purposes ofthe example, the

Run coil is used.

So, the steps and the transition conditions that indicate the end of each step are:

Step Transition Condition (out of step)

Parts into tub Part_Ctr done ( 100 parts detected) and Run

Open Gate l GATEl OPLS on and Run

Hold Gate 1 open GI_Hold_Tmr done (TUB_PROX offfor 3 sec.)

Close Gate I GA TE I CLLS on and Run

Open Gate 2 GATE2 OPLS on and Run

Hold Gate 2 open G2_Hold_Tmr done (TUB_PROX on for 5 sec.)

Close Gate 2 GATE2 CLLS on and Run

The next part of the function chart development is to add the actions to each step.

Reading back through the tub loader narrative, the process actions for each step are:

Step Actions

Parts into tub BELT_RUN and Tub_Permissive and Part_Ctr (counts 100

parts with /PE272)

Open Gate 1 GATEl RET

Hold Gate I open GATEl_RET and TROLL_RUN and Gl_Hold_Tmr (3 sec.)

Close Gate 1

Open Gate 2 GATE2 RET

Hold Gate 2 open GATE2_RET and TROLL_RUN and G2_Hold_Tmr (5 sec.)

Close Gate 2
6 . 3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 313

The function chart for the tub loader is shown in Figure 6 . 1 5 . This particular operation

repeats, indicated by a line from the last step back to the first step. Before developing the

ladder logic code, the interna! variables should be identified:

The addresses or data types associated with the variables:

Initial

Run

BELT RUN
Parts Into
Step_l
Tub Permissive
Tub
Part_Ctr (preset= 100)

Part Ctr done .and. Run

GATEI RET
Step_2 Open Gate 1

GATEl OPLS .and. Run

GATEI RET
Hold Gate 1
Step_3
TROLL RUN
Open
Gl_Hold_Tmr (3 sec)

G1 Hold Tmr done

Step_4 Close Gate 1

GATEI CLLS .and. Run

GATE2 RET
Step_5 Open Gate 2

GATE2 OPLS .and. Run

GATE2 RET
Hold Gate 2
Step_6
TROLL RUN
Open
G2_Hold_Tmr (5 sec)

G2 Hold Trnr done

Step_7 Close Gate 2

GATE2 CLLS .and. Run

Figure 6.15. Function chart for parts tub loader.


314 Sequential Applications

Modicon PLC-5 ControlLogix Siemens GEFanuc

Variable Data Type Addr. Data Ty2e Data Type Addr.

Step_l to 800L 820/1 800L M50.l %M51

Step_7 800L 820/7 800L M50.7 %M57

Int Reset 800L 820/8 800L M51.0 %M58

Ctr Done n/a n/a n/a n/a %M59

Part Ctr n/a C5:l COUNTER D82 %R101

Gl Hold Trnr n/a T4:l TIMER TI %R104

G2 Hold Trnr n/a T4:2 TIMER T2 %R107

The ladder logic code is broken into the following sections:

Start/stop/pause of overall operation

First start

Transitions between steps

Step actions

Since the timers and counters are shown as actions, they may be placed with the rungs

that drive the physical outputs. However, since they are also part ofthe transitions, they may

also be placed with the rungs handling the transitions. The author favors the latter approach

since the transition condition is more likely to be changed.

The Modicon Concept IEC 6 1 1 3 1 - 3 code for the tub loader, shown in Figure 6 . 1 6 , is

developed using the code templates shown earlier in this chapter. A rung comment is shown

within a rectangle above the rung. The function of each rung is as follows:

1. First start (starting the operation for the very first time)

2. Transition from step 1 to step 2 and counting parts

3. Transition from step 2 to step 3

4. Transition from step 3 to step 4 and delay tub prox. off

5. Transition from step 4 to step 5

6. Transition from step 5 to step 6

7. Transition from step 6 to step 7 and dela y tub prox. on

8. Transition from step 7 to step 1

9. Control ofbelt conveyor (an action for step 1)

1 O. Control of roller conveyor (an action for steps 3 and 6)

11. Control of gate 1 cylinder (an action for steps 2 and 3)

12. Control of gate 2 cylinder (an action for steps 5 and 6)

13. Control ofTub_Permissive (an action for step 1)

14. Reset of steps

Since Modicon Concept does not define a retentive on-delay timer, one must be

constructed as outlined in Chapter 5. On rungs 4 and 7 a non-retentive TON timer generates

a "tick" every 0 . 1 seconds which is counted. The counter provides the retentive function.

The Run interna! coil is part ofthe input condition for each retentive timer, thus pausing the

timer when the station operation is paused.

The reset condition for each counter must also be defined. Two situations must be

considered: normal operation and operator-initiated reset. For this solution, the next step is

used to normally reset each counter. The operator-initiated reset tums on the Int_Reset

interna! coi! to reset the counters. For example, the counter used to count parts in step 1 is

reset when the operation is in step 2 or when Int_ Reset is on (Figure 6 . 1 6 , rung 2).
6 . 3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 315

Generate transition out of initial step.

Run Step_l Step_2 Step_3 Step_4 Step_5

H/H/H/H/HIH¿
Step_6 Step_7 Step_l

¿H/H/�
! Step 1 - Count parts. Trans. to Step 2 when 100 parts has passed. 1

Part_Ctr

Step_l PE272 Run 'Step_2


CTU

2 cu Q
1 1 /

Step_l

R
/ �

100 PV cv

I Step 2 - Open gate 1 . Trans. to Step 3 when open.

Step_2 GATEI OPLS Run Step_3

3
1 1 -1 1 -1--..........-
� - s

L+
GIH Tic

Step 3 - Hold gate I open for 3 secs after

tub passes. Trans. to Step 4 when done.

GJTic_Tmr G l _Hold_Tmr

Step 3 TUB PROX Run G 1H Tic


TON CTU

IN Q ,_____, CU Q
4
H;H H/
Step_3 t#IOOms PT ET R

!------� PV CV

(¡ Step_ 4

tl
I Step 4 - Close gate 1 . Trans. to Step 5 when c l o s e d . 1

Step_4 GATEI CLLS Run Step_5

5
1 1 -1 1 -1-------,--
� - s

Figure 6.16. Modicon Concept ladder logic for tub loader. (continued)
316 Sequential Applications

I Step 5 - Open gate 2. Trans. to Step 6 when open.¡

Step_5 GATE2 OPLS Run Step_6

6
1 1 -1 1 1---
1 - ---r--
� � s


G2H Tic

Step 6 - Hold gate 2 open for 5 secs after

tub in. Trans. to Step 7 when delay done.

G2Tic_Tmr G2_Hold_Tmr

Step 6 TUB _pROX Run G2H _Tic


TON CTU

7 IN Q CU Q
H H H/ 1---..__---1

Step_6 t# I O O m s PT ET R

/ 1-----------------� 50 PV CV


tt :
t_
S7

Step_6

R
Step 7 - Close gate 2. Trans to Step I when closed.

Step_7 GATE2 CLLS Run Step_I

8
1
1 --1-1 -1--.....---
� - s

�IB_e
_ _
l tc
_ o
_ n
_ v
- e
y_o
_ r
_ c
- o
n_tr
_ o
_ �
I ! �

Step_l Run BELT RUN

9 1 1 -1 ����----o-
I Roll conveyor control I

Step_3 Run TROLL RUN

10 t-T-1 -1 �����o-
S te p_ µ

I Gate I cylinder control

Step_2 GATEI RET

1 1 -�-.--������o-
Ste p_ µ
I Gate 2 cylinder control

Step_5 GATE2 RET

12
-�-.--�����--o-
Ste p_�

Figure 6.16. (continued)


6 . 3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 317

I Tub permissive control I

Step_l Run Tub Pennissive

13
1 1 -1 ------o-
Reset steps, provide reset for counters

Reset Run lnt_Reset

14

Step_l

Step_2

Step_3

Step_4

Step_5

Step_6

Step_7

Figure 6.16. (continued)

When the reset push button is pressed while the station is paused, the Int_Reset coi! is

turned on (to reset the counters) and ali step-in-progress coils are reset. This action

effectively places the station operation in the initial state.

The Allen-Bradley PLC-5 code for the tub loader appears in Figure 6 . 1 7 . Besides the

use of latch/unlatch in place of set/reset, the only real difference is in the timers and

counters. Timers and counters are output instructions, and so no logic can appear in series to

the right ofthese instructions. Therefore, a parallel branch is used to handle the transition to

the next step (Figure 6 . 1 7 , rungs 2, 4, and 7). These parallel branches can be programmed as

two rungs. However, in keeping with the convention that timers and counters remain with

the transition condition, they are combined on a single rung. As with the IEC 6 1 1 3 1 - 3 code,

the Run interna! coi! is part ofthe input condition for each retentive timer, thus pausing the

timer when the station operation is paused.

The counters and retentive timers are normally reset during the transition to the next

step. For example, the Part_Ctr counter used in step 1 to count parts is reset during the

transition from step 1 to step 2 (Figure 6 . 1 7 , rung 3). The reset of retentive timers and

counters as a result of an operator-initiated reset is handled on the same rung as the reset of

ali step-in-progress coils (Figure 6 . 1 7 , rung 14).

The Allen-Bradley ControlLogix ladder logic code is nearly identical to the PLC-5

code in Figure 6 . 1 7 . The only differences are:


318 Sequential Applications

Generate transition out of initial step

Step_l Step_2 Step_3 Step_4 Step_5

!! H H H H �

s�-7<���-<���-<���-<���<�---1���'

Step 1 - Count parts. Trans. to Step 2 when 100 parts has passed.

Part Ctr
Step_l PE272
CTU-----

2 1-----1 1--�--�/J.---------, CountUp

Counter C5:l

Preset 100

Accum o

Part Ctr/DN Run Step_2

- 1---
[-]
L

Step_l

u
Part Ctr

I Step 2 - Open gate 1 . Trans. to Step 3 when open.

Step_2 GATEI OPLS Run Step_3

3 1------<
i---
[-]---[-] --
[--��- L

w�-2
Step 3 - Hold gate 1 open for 3 secs after tub passes. Trans. to Step 4 when done.

GI Hold Tmr
Step_3 TUB PROX Run
RTO-----,

4 1--.......-----1,.'I----� 1-------1 Retentive Timer On

Timer T4:l

Time Base 0.01

Preset 300

Accum O

G1 Hold Tmr/DN Step_4

Step_3

Gl Hold Tmr

Figure 6.17. Allen-Bradley PLC-5 ladder logic for tub loader. (continued)
6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 3 19

Step 4 - Close gate 1 . Trans. to Step 5 when closed.

Step_ 4 GATEl CLLS Run Step_5

5
[ 31 3 t--
[ ----,--M- L

w�-4
I Step 5 - Open gate 2. Trans. to Step 6 when open.¡

Step_5 GATE2 OPLS Run Step_6

6
[ 31 3 t--
[ ----,--M- L

w�-5
Step 6 - Hold gate 2 open for 5 secs after tub in. Trans. to Step 7 when delay done.

G2 Hold Tmr
TUB PROX Run
RTO------.

7 1-------l Retentive Timer On


[ 3
Timer T4:2

Time Base 0.01

Preset 500

Accum O

G2 Hold Tmr/DN Step_7

G2 Hold Tmr

I Step 7 - Close gate 2. Trans to Step 1 when closed. 1

Step_7 GATE2 CLLS Run Step_l

8 ,________.
[ 31 3 ----.--M-
t--
[ L

w�-'
I Belt conveyor control

Step_l Run BELT_RUN

9 1-------1
[ 3

I Roll conveyor control

Step_3 Run TROLL RUN

10 1-..-----1 h-3
Step�

Figure 6.17. (continued)


320 Sequential Applications

I Gate 1 cylinder control

Step_2 GATEI RET

1 1 i-.-----1 -�----.--�������c-
Step�

I Gate 2 cylinder control

Step_5 GATE2 RET

12 i-.-----1 ��������------ic-
Step�

I Tub permissive control

Step_l Run Tub Permissive

1 3 ,_____,
E 3

I Reset steps, reset counter and timers

Reset Run Step_l

Step_2

Step_3

Step_4

Step_5

Step_6

Step_7

Part Ctr

G1 Hold_Tmr
-

G2_Hold_Tmr

RES

Figure 6.17. (continued)


6 . 3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 321

l . The "Part_Ctr" tag appears in the Counter field ofthe CTU instruction in rung 3,

replacing the address in the PLC-5 CTU instruction.

2. For the timers (rungs 5 and 8), the "Time Base" field is absent and the Preset value

is multiplied by 1 O (ControlLogix time base is 1 ms). Also, the timer tag appears in

the Timer field ofthe RTO instruction, replacing the address in the PLC-5 RTO

instruction.

The Siemens S7 ladder logic code (Figure 6 . 1 8 ) looks most similar to the Modicon

PLC. The only differences are in the retentive timers and the counter. The S_ODTS

retentive on-delay timer block is used in place of an IEC-compatible TON and CTU as in

the Modicon PLC. Also note the use of the "Part_Ctr" .Q contact on the ENO output of the

counter. Since the CTU block Q ouput can only connect to a variable, this method allows

one to place the "Run" contact in series with the Q output and to control the set and reset

coils without starting a new network.

The GE Fanuc ladder logic is shown in Figure 6 . 1 9 and is similar to the Modicon and

S7 ladder logic. Since the output of the counter in rung 3 cannot connect to a contact, an

extra interna! coi! and rung must be added to accommodate the specification that the

operation cannot advance to the next step when paused.

Generate transition out of initial step

¡HR""�(

"Step_6" "Step_7" "Step_l"

tH/H/1 ( s H

Step 1 - Count parts. Trans. to Step 2 when 100 parts has passed.

"Part Ctr"

"CTU" "Part_Ctr". Q "Step_2"


"Run"

2 EN ENO
H

W�-�
"Step_l" "PE272"

cu Q

"Step_l"

R cv

100 PV

I Step 2 - Open gate 1 . Trans. to Step 3 when open.

_2" "GATEI OPLS" "Run" "Step_3"

3
--·----11
1 --1----1 � s H

�'Step Y�H
Figure 6.18. Siemens S7 ladder logic code for tub loader. (continued)
322 Sequential Applications

Step 3 - Hold gate I open for 3 secs after tub passes. Trans. to Step 4 when done.

"G 1 Hold Tmr"

"Step_3" "TUB PROX'.' "Run" S ODTS "Step_4"

4 s Q sH
1 1/1

S5T#3S TV BI
"Step_3"

R BCD
/

I Step 4 - Close gate 1. Trans. to Step 5 when closed. ¡

s f "Pr "GATnLLS" rT
"Step_5"

d�-�
I Step 5 - Open gate 2. Trans. to Step 6 when open.¡

6 F"Pf "GATr-tS" T"T


"Step_6"

LH-�
Step 6 - Hold gate 2 open for 5 secs after tub in. Trans. to Step 7 when delay done.

"G2 _Hold _Tmr"

"Step 6" "TUB PROX" "Run" S ODTS "Step_7"

7 s Q sH
l 1- 1
1

"Step_6"
S5T#5S TV 81

RH
R BCD

I Step 7 - Close gate 2. Trans to Step 1 when closed. 1

--u-
"GATE2 CLLS" "Run" "Step_l"

1 -li---------ll -1 s H

"St;_H

I Belt conveyor control I

9
�tepi1" "Runt-"------------"---1BELT H"
Figure 6.18. (continued)
6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 323

"TROLL RUN"

I Gate 1 cylinder control I

�t 2" "GATEl RET"

u w:�wl-
. ---.---------------1(
3 -H

1 Gato:��::�do,co"m>I "GATE2_RET"

" "
'
-
SJ -,-----------1(
t--
6
" H

I Tub permissive control

1 "S tep_l" "Run" "Tub Pennissive"


1

13 � 1---
H
Reset steps, provide reset for counters

11 11

"Reset" Run "lnt Reset"

14 �!/------�-- H
"Step_l"

RH
"Step_2"

RH
"Step_3"

RH
"Step_ 4"

RH
"Step_S"

RH
"Step_6"

RH
"Step_7"

RH
Figure 6.18. (continued)
324 Sequential Applications

Genera te transition out of initial step

Run Step_l Step_2 Step_3 Step_4 Step_5

H/H/H/H/H/Ht
Step 6 Step 7 Step_ 1

«---1/H/1--I-e s H

Step 1 - Count parts. Trans. to Step 2 when 100 parts has passed.

Step_l Ctr Done


UPCTR

2
1
Part Ctr
H
Step_l

/i--------1R

100 PV

Ctr Done Run Step_2

1 -1 ----e- s
Step_l
H

RH
I Step 2 - Open gate 1 . Trans. to Step 3 when open.

--e-
Step_2 GATEI OPLS Run Step_3

3
1 1 -1 1 1--I s H
Step_2

RH
Step 3 - Hold gate I open for 3 secs after tub passes. Trans. to Step 4 when done.

Step_4
Step 3 TUB PROX Run ONDTR

4
HIH SEC sH
Step_3 GJ Hold ..

/--------1R

30 PV

Step 4 - Close gate 1 . Trans. to Step 5 when closed.

--u-
Step_4 GATEI CLLS Run Step_5

5
1
1 --1-1 -1 s H
Step_4

RH
Figure 6.19. GE Fanuc ladder logic code for tub loader. (continued)
6.3 IMPLEMENTING FUNCTION CHART IN LADDER LOGIC 325

I Step 5 - Open gate 2. Trans. to Step 6 when open.¡

--u-
Step_5 GATE2 OPLS Run Step_6

6
1 1 - 1 1 -1 sH
Step_5

RH
Step 6 - Hold gate 2 open for 5 secs after tub in. Trans. to Step 7 when delay done.

Step_7
Step 6 TUB PROX Run ONDTR

7 H-H SEC
sH
Step _6 GI Hold .. Step_6

/1----------1 R RH

50 PV

I Step 7 - Close gate 2. Trans to Step 1 when closed. 1

Step_7 GATE2 CLLS Run Step_l

8
1 1 - 1 1 1---I --usH
Step_7

RH
I Belt conveyor control I

Step_l Run BELT RUN

9 t----i

1 1 H
I Roll conveyor control I

Step_3 Run TROLL RUN

10
H
St�tr

I Gate 1 cylinder control

Step_2 GATEl RET

11 ��Step_wt-----r-------------( H

I Gate 2 cylinder control

Step_5 GATE2 RET

12
-h-.-������-c H
Step_�

Figure 6.19. (continued)


326 Sequential Applications

I Tub permissive control

Step_l Run Tub Permissive

13 -,-- H

Reset steps, provide reset for counters

Re set Run Int Reset

14 1-------11/----.--,--f H
Step_l

RH
Step_2

RH
Step_3

RH
Step_ 4

RH
Step_5

RH
Step_6

RH
Step_7

RH
Figure 6.19. (continued)

6.4 COMPLICATED RESET OPERA TION

Example 6.3 has most ofthe features of a real application. The next example illustrates

a problem in which the reset operation is more complicated than in the previous example.

Example 6.4. Engine Inverter Station Control. Design the function chart ofthe program to

control the following station that inverts (tums over) gasoline engine assemblies and

implement the control with ladder logic.

Figure 6.20 shows the layout of a station that inverts gasoline engine

assemblies riding on a pallet as they come down the conveyor. This station is only

one in a series of stations along this conveyor. Implement ladder logic for this

station only. The conveyor is controlled by another PLC, so assume it is always

moving. This particular line is asynchronous, that is, each station processes

assemblies at its own speed and <loes not coordinate its operation with any other

station. Because this is an asynchronous line, the station contains two capturing

mechanisms ( engaging hooks) that control access to the station and allow pallets to

queue up before the station.


6.4 COMPLICA TED RESET OPERA TION 327

Engaging Engaging

Hook 1 Hook2

PROXl

Proximity
t
Front View from
Sensor
this direction

(a)

I e ) 1 ...- Rotator mechanism

Conveyor 1 1 1 1 1 1 1

n
í
PROXl

Proximity� U
Sensor Engage 1
Pallet Up
Cylinder
Cylinder

(b)

Rotator/Gripper

¡
ROTR UPLS _/-

ROTR DNLS _/-

Raising/

Lowering
Conveyor
Cylinder
Pallet Up

Cylinder

(e)

Figure 6.20. Engine inverter station: (a) top view; (b) front view; (e) side view.
328 Sequential Applications

U pon initial startup, assume that there are no pallets waiting at engaging hook

Engage 1 . When a pallet is detected at Engage 1 (by PROXl ), the following major

steps are executed:

Lower the Engage 1 hook (by activating ENG l _RET) for 2 seconds to

allow only one assembly to move into the station and be caught by

the Engage 2 hook. When the Engage 1 hook is raised, it catches the

next pallet.

Raise the pallet off the conveyor.

Lower the rotator mechanism to the correct position (ROTR_DNLS

closed).

Clamp the engine.

Raise the rotator mechanism (until ROTR_UPLS closes).

Rotate the engine one-halfturn clockwise (until ROTR_CWLS closes).

Lower the rotating mechanism to the correct position (ROTR_DNLS

closed).

Unclamp the engine.

Raise the rotator mechanism (until ROTR_UPLS closes).

Rotate the clamp one-half turn counterclockwise (until

ROTR_CCWLS closes).

Activate the ENG2_RET for 3 seconds to allow pallet to move out.

The operation then repeats. Assume the conveyor is on at ali times. The

conveyor consists of two parallel tracks and slides beneath the pallets as they are

held by the engaging hooks or raised off the conveyor.

The proximity sensor, PROX I , is inductive and senses the metal assembly

pallet. PROXl senses the pallet before tbe pallet reaches the engage position. You

must assume that when Engage 1 , the first engaging hook, captures the pallet,

PROXl remains o n .

ENG l _RET and ENG2 _RET are controls for single action pneumatic

cylinders that move the engaging hooks. Once ENG l _RET is energized, the

Engage 1 hook moves down and remains in the "down" position as long as power

is applied (turned on). The hook moves up when power is removed (turned off).

The engaging mechanism works in this manner to be fail-safe, that is, if electrical

power or air pressure is interrupted because of a failure, no pallets proceed down

the conveyor. ENG2_RET controls the second engaging hook, Engage 2, in a

similar manner.

The pallet-raising mechanism is driven by a single-action pneumatic cylinder

controlled by PALL_UPCTL. Once the PALL_UPCTL output is energized, the

clamp moves the pallet (and engine) offthe conveyor and into a fixture to properly

align the engine to the gripper clamp. PALL_UPCTL must remain on to hold the

assembly in the fixture. If PALL_UPCTL is turned off, the pallet falls back onto

the conveyor. The PALL_UPLS is on when the pallet is in the proper position.

The mechanism used to lower and raise the rotating mechanism consists of a

double-action linear hydraulic cylinder. When the ROTR_DOWN output is

energized (turned on), the rotator moves down and continues to move down as

long as it is energized and a mechanical stop is not reached. When the ROTR_UP
6.4 COMPLICA TED RESET OPERA TION 329

output is energized, the rotator moves up and continues to move up as long as it is

energized and a mechanical stop is not reached. The mechanism stops if neither

output is on, or ifthey are energized simultaneously. ROTR_UPLS is on when the

rotator is in the "up" position. ROTR_DNLS is on when the rotator is in the

"down" position.

The gripper is powered by a single-action pneumatic cylinder. When the

GRIP _CLOS output is energized, the gripper jaws close to clamp the engine and

hold it in place as long as power is applied (tumed on). GRIP _CLOS must remain

on to hold the engine in the gripper. If GRIP _CLOS is turned off, the engine is

released. There are no limit switches indicating the gripper is open or closed.

Allow 1 . 5 seconds for the gripper to clamp (el ose) and 1 . 0 seconds for the gripper

to unclamp (open).

A double-action pneumatic rotary cylinder controls the rotation action ofthe

gripper. When the ROTA T_CW output is energized, the gripper ro tates clockwise

as long as power is applied (tumed on) and the CW mechanical stop has not been

reached. When the ROTA T_CCW output is energized, the gripper rotates

counterclockwise as long as power is applied (tumed on) and the CCW

mechanical stop has not been reached. The rotation stops at its current position

when power is removed (tumed off). The rotation will not move ifboth opposing

directions are energized simultaneously (e.g., CW and CCW). ROTR_CWLS is

on when the gripper is fully clockwise. ROTR_CCWLS is on when the gripper is

fully counterclockwise.

The start/stop switches are only for the station. They do not control any other

stations or the conveyor. Upon initial startup, assume there are no pallets present in

either of the engaging hooks. If the stop switch is pres sed at any time, the station

operation should pause, except when either engaging hook is activated. If the

operation is paused when ENGl_RET is activated the station may contain two

pallets with no space in between. When the start switch is pressed while the

operation is paused, the station should resume the suspended step. When paused,

do not advance to the next step. When the station is paused, the raise/lower and

rotating cylinder controls should be tumed off. The engine clamping gripper and

the pallet raising cylinders must remain on when paused (or the engine may be

dropped).

A separate reset switch is provided that when pressed, the clamp gripper is

released, the rotating mechanism is raised, then rotated counterclockwise, and the

process step is set as if the process is waiting for the next pallet. When the start

switch is next pressed, no items are assumed present at the first engage position.

The reset switch should have no effect unless the operation is already paused.

Assume the tolerance on ali timer values is ± 0 . 1 seconds.

Assume the following physical input and physical output assignments.

Variable Description

START PB Start push button, N. O ., on when starting.

STOP PB Stop push button, N. C ., off when stopping.

RESET PB Reset push button, N. O . , on when restoring station to initial

state.
330 Sequential Applications

PROXl Proximity sensor, on (closed) when pallet is either approaching

or at the Engage 1 hook position.

PALL UPLS Limit switch, on when the pallet is lifted off conveyor and in the

proper position.

ROTR UPLS Limit switch, on (closed) when rotating mechanism is up.

ROTR DNLS Limit switch, on (closed) when rotating mechanism is down

(can clamp/unclamp engine).

ROTR CWLS Limit switch, on (closed) when rotary solenoid is clockwise.

ROTR CCWLS Limit switch, on (closed) when rotary solenoid is

counterclockwise.

ENGl RET Engage hook l cylinder retract control, on to lower hook, off

raises hook.

ENG2 RET Engage hook 2 cylinder retract control, on to lower hook, off

raises hook.

ROTR UP Rotating mechanism raise cylinder control, on to raise.

ROTR DOWN Rotating mechanism lower cylinder control, on to lower.

ROTAT CW Clockwise rotary cylinder control, on to rotate clockwise.

ROTAT CCW Counterclockwise rotary cylinder control, on to rotate

counterclockwise.

GRIP CLOS Gripper cylinder control, on closes jaws, off opens jaws.

PALL UPCTL Pallet retainer cylinder control, on to move pallet up and offthe

conveyor and retain it there, off lowers pallet back onto

conveyor.

The addresses associated with the physical inputs and outputs are:

Variable Modicon PLC-5 ControlLogix Siemens GEFanuc

START PB 1 00001 l : 0 1 /00 Local: 1 :!.Data.O IO.O %181

STOP PB 100002 l :O 1/01 Local: 1 :I.Data. l IO.l %182

RESET PB 100003 I:01/02 Local: 1 :I.Data.2 I0.2 %183

PROXl 100004 l:01/03 Local: 1 :I.Data.3 I0.3 %184

PALL UPLS 100005 1:01/04 Local: 1 :I.Data.4 I0.4 %185

ROTR UPLS 100006 I :O 1/05 Local: 1 :I.Data.5 I0.5 %186

ROTR DNLS 100007 1 : 01 /06 Local: 1 :I.Data.6 I0.6 %187

ROTR CWLS 100008 1:01/07 Local: 1 :I.Data.7 I0.7 %188

ROTR CCWLS 100009 I:01/10 Local: 1 :I.Data.8 Il.O %189

ENGl RET 000001 0:02/00 Local:2:0.Data.O Q4.0 %Ql

ENG2 RET 000002 0:02/01 Local:2:0.Data. l Q4.l %Q2

ROTR UP 000003 0:02/02 Local:2:0.Data.2 Q4.2 %Q3

ROTR DOWN 000004 0:02/03 Local:2:0.Data.3 Q4.3 %Q4

ROTAT CW 000005 0:02/04 Local:2:0.Data.4 Q4.4 %Q5

ROTAT CCW 000006 0:02/05 Local:2:0.Data.5 Q4.5 %Q6

GRIP CLOS 000007 0:02/06 Local:2:0.Data.6 Q4.6 %Q7

PALL UPCTL 000008 0:02/07 Local:2:0.Data.7 Q4.7 %Q8


6.4 COMPLICATED RESET OPERATION 331

Solution. The function chart forthe station is shown in Figure 6 . 2 1 . Run is not really needed

as a transition condition out of steps 3 , 4, 6, 7, 8, 1 0 , and 1 1 since the motion ceases when

paused. One could argue that Run is not needed as part of the transition condition out of

steps 5 and 9 since advancing to the next step does not actually tum on any physical outputs

(since they will remain off as long as the station is paused). Non-retentive timers are

acceptable for steps 5 and 9 since the clamping/unclamping will still occur since the gripper

continues to function when the operation is paused. Likewise, non-retentive timers are

acceptable for steps 2 and 1 3 since the operation cannot be paused in these steps.

For this problem, the operator-initiated reset is not merely resetting all counters,

retentive timers and step-in-progress bits. A sequential operation must restore the

mechanical parts of the system to the initial state (clamp open, rotating mechanism in up and

counterclockwise positions). The fünction chart of the reset operation is shown in Figure

6.22. Note that the last step exists only to reset the Int_Reset interna! coil, that indicates the

reset operation is in progress and prevents the station from restarting.

Initial

Run

B 1-------lM

Wait for
Step_l
pallet

PROXl .and. Run

AllowNext ENGl RET


Step_2
Oneln Engl_Tmr = 2 s

Engl_Tmr done

PALL UPCTL
Step _3 Raise Pallet

PALL UPLS .and. Run

Lower PALL UPCTL


Step_4
Rotator ROTR DOWN

ROTR DNLS .and. Run

PALL UPCTL
Step_5 Clamp Engine
GRIP CLOS

Clmp_Tmr = 1.5 s

Clmp _Tmr done .and. Run

Figure 6.21. Function chart for engine inverter station. (continued)


332 Sequential Applications

PALL UPCTL
Raise
Step_6
GRIP CLOS
Rotator
ROTR UP

ROTR UPLS .and. Run

PALL UPCTL
Rota te
Step_7
GRIP CLOS
Clockwise
ROTAT CW

ROTR CWLS .and. Run

PALL UPCTL
Lower
Step_8
GRIP CLOS
Rotator
ROTR DOWN

ROTR DNLS .and. Run

Unclamp PALL UPCTL


Step_9
Engine Unclmp_Tmr = 1 s

Unclmp_Tmr done .and. Run

Raise PALL UPCTL


Step_lO
Rotator ROTR UP

ROTR UPLS .and. Run

PALL UPCTL
Step_l l Rotate Counter­
clockwise ROTAT CCW

ROTR CCWLS .and. Run

Step_ 1 2 Drop Engine

/PALL UPLS .and. Run

Move Out ENG2 RET


Step_13
Pallet Eng2_Tmr = 3 s

Eng2 _Tmr done

Figure 6.21. (continued)


6.4 COMPLICA TED RESET OPERA TION 333

Initial

Int Reset

RUnClmp_Tnu=ls
RStep_l Open Gripper

RUnClmp_Tmr done

Raise ROTR UP
RStep_2
Rotator

ROTR UPLS

Rotate Counter­ ROTAT CCW


RStep_3
clockwise

ROTR CCWLS

Unlatch Unlatch Int Reset


RStep_4
Interna! Reset

/Int Reset


Figure 6.22. Function chart for reset.

Before developing the ladder logic code, the interna! variable addresses or data types

should be identified:

Modicon PLC-5 Contro!Logix Siemens GEFanuc

Variable Data Type Addr. Data Ty2e Addr. Addr.

Step_l to 800L 820/1 800L M50.l %Ml

Step_l3 800L 820/13 800L M51.5 %Ml3

RStep_l to 800L 820/41 800L M52.l %M41

RStep_4 800L 820/44 800L M52.4 %M44

Run 800L 820/0 800L MO.O %M39

Int Reset 800L 820/40 800L MO.l %M40

Engl_Tmr n/a T4:l TIMER D81 %Rl

Eng2_Tmr n/a T4:2 TIMER D82 %R4

Clmp_Tmr n/a T4:3 TIMER D83 %R7

UnClmp_Tmr n/a T4:4 TIMER D84 %Rl0

RUnClmp_Tmr n/a T4:5 TIMER D85 %Rl3

The Modicon Concept code is shown in Figure 6 . 2 3 . The Allen-Bradley PLC-5 code is

shown in Figure 6.24. The ladder logic code is broken into the following sections:
334 Sequential Applications

Start/stop/pause. Start prevented if reset in progress

START PB lnt Reset STOP PB Run

1 1 / 1t-----, ..----ti t--1 --------10-


Run

Generate transition out of initial step

Run Step_l Step_2 Step_3 Step_ 4 Step_5 Step_6 Step_7

2
H/H/H/H/H/H/H/H¿
Step_8 Step_9 Step_JO Step_l l Step_l2 Step_l3 Step_l

¿H/H/H/H/H/H/�
I Step 1 - Wait for pallet. Trans. to Step 2 when pallet present. l

Step_l PROXI Run Step_2

3
1 1 1 1 -1 -------r-
� -s

L©-
Step 2 - Move to hook 2. Trans. to Step 3 when engaging 1 hook open 2 sec.

Engl_Tmr

Step_2
TON

4 t--------t IN Q t-----------.----1

t#2s PT ET

I Step 3 - Raise pallet. Trans. to Step 4 when up. 1

Step_3 PALL UPLS Run Step_4

5
1 1 - 1 1 --1 --��-s

Step 4 - Lower rotator. Trans. to Step 5 when down.


L+
Step_4 ROTR DNLS Run Step_5

6
1
1 - -1-----1
1 -1--��- s


Step 5 - Clamp engine. Trans. to Step 6 when timer done.

Clmp_Tmr

Step_5 Run
TON

7 ----- IN Q i-------i

t#l.5s PT ET

Figure 6.23. Modicon ladder logic for engine inverter station. (continued)
6.4 COMPLICATED RESET OPERATION 335

Step 6 - Raise rotator. Trans. to Step 7 when up.

Step_6 ROTR UPLS Run Step_7

8
1
1 -11--------1
1 i--
l - ---.-
� - s


Step 7 - Rotate clockwise. Trans. to Step 8 when clockwise.

Step_7 ROTR CWLS Run Step_8

9
1
1 - 1---I-----1
1 1--
1 - ---.-
� - s

Step 8 - Lower rotator. Trans. to Step 9 when down.


L+
Step_8 ROTR DNLS Run Step_9

10
1
1 - ---1---11 i-----
l - --r--
� - s


Step 9 - Unclamp timer. Trans. to Step 1 0 after I sec.

Unclmp_Tmr

Step_9 Run

11
1
Wj�TONE�l 1

I Step I O - Raise rotator. Trans to Step 1 1 when up. ¡

Step_lO ROTR UPLS Run Step_l l

12
1 1 - 1 1 -1--------r--
� ----1 s


I Step 1 1 - Rotate CCW. Trans. to Step 1 2 when CCW. 1

Step_ll ROTR CCWLS Run Step_l2

13
1 1- 1 1 1--I--��-- s


Step 1 2 - Drop engine. Trans. to Step 1 3 when not up.

Step_l2 PALL UPLS Run Step_13

14
1
1 7 1---I-----1
1 1--I--------r--
� ----1 s


Step 1 3 - Move out pallet. Trans. to Step I when time done.

Eng2_Tmr

Step_l3
TON

15 1-------1 IN Q 1------------.---i

t#3s PT ET

Figure 6.23. (continued)


336 Sequential Applications

I Engaging hooks control I

Step _2 ENG 1 RET

16 -1 ������--o-
Step_l3 ENG2 RET

17 -1 ������--o-
I Rotating mechanism up/down control I

Step_6 Run ROTR UP

1 8

Step_tt

RStep_2

Step_ 4 Run ROTR DOWN

19
11------�o-
Step�

Rotation control I

Step_7 Run ROTAT CW

20
1 1 11-------0-

Step _ 1 1 Run ROTAT_CCW

21
1 1 --1 -----o-
RStep_3

I Gripper control

Step_S GRIP CLOS

22

Step_6

Step_7

Step_8

Figure 6.23. (continued)


6.4 COMPLICATED RESET OPERATION 337

I Pallet up control

Step_3 PALL UPCTL

23 1-----l

Step_4

Step_5

Step_6

Step_7

Step_8

Step_9

Step_lO

Step_I l

Start/stop for reset operation. Reset pb starts, reset step 4 stops it.

RESET PB Run RStep_4 lnt Reset

24

_1.,_""�/1--I--------ID-

j First press of reset pb starts reset.


1

Int Reset RStep_l RStep_2 RStep_3 RStep_4 RStep_l

25
H/H/H/H/�
Reset Step 1 - Delay to unclamp. Transition to Reset Step 2 when done.

RUnClmp_Tmr

RStep_l
TON

26 ,__ _, IN Q 1----------��-�

t# l s PT ET

Reset Step 2 - Raise mechanism. Trans. to Reset step 3 when up.

RStep_2 ROTR UPLS RStep_3

27
1 , -
-
, ----.....--
� s-

Figure 6.23. (continued)


338 Sequential Applications

Reset Step 3 - Rotate CCW. Trans. to Reset step 4 when CCW.

RStep_3 ROTR CCWLS RStep_ 4

28
1 1- -
1 ---------r
� - s


Transition out ofReset Step 4 when internal reset unlatched.

RStep_4 Int Reset RStep _4

29
-1-----117-1 ------®--
I Reset steps of main operation. ¡

Int Reset

30

Figure 6.23. (continued)


6.4 COMPLICATED RESET OPERA TION 339

Start/stop/pause. Start prevented if reset in progress.

START PB Int Reset STOP PB Run

R{ M J -[---------1(

Step 1 - Wait for pallet. Trans. to Step 2 when pallet present.

Step_l PROXI Run Step_2

3 1------1
E ] E ] -[ --------.--M- L

w�-1
I Step 2 - Move to hook 2. Trans. to Step 3 when engaging 1 hook open 2 sec.

Engl_Tmr

Step_2 TON----�

4 1--......---------------1 Timer On Delay

Timer T4:1

Time Base 0.01

Preset 200

Accum o
Engl_Tmr/DN Step_3

[]�'
I Step 3 - Raise pallet. Trans. to Step 4 when up. 1

Step_3 PALL UPLS Run Step_4

5
[ TE ] -
[ --�M----1 L

w�-3
Step 4 - Lower rotator. Trans. to Step 5 when down.

Step_4 ROTR DNLS Run Step_5

6 - -E-r-E-J -
E --�M----1 L

w�-4
Figure 6.24. PLC-5 ladder logic for engine inverter station. (continued)
340 Sequential Applications

Step 5 - Clamp engine. Trans. to Step 6 when timer done.

mp_Tmr

Step_5 TON----�

T4:3

Time Base 0.0 1

Preset 150

Accum O

Clmp_Trnr/DN Run Step_6

E 3 -[ ---.--M- L

L-c�-5
Step 6 - Raise rotator. Trans. to Step 7 when up.

Step_6 ROTR UPLS Run Step_7

8 t-----i
E rE J 1---
E ---..-M---1 L

L-c�-6
Step 7 - Rotate clockwise. Trans. to Step 8 when clockwise.

Step_7 ROTR CWLS Run Step_8

9 t-----i

E Ti---[ -JE 1-----------.--M- L

L-c�-7
Step 8 - Lower rotator. Trans. to Step 9 when down.

Step_8 ROTR DNLS Run Step_9

1 0 --- E Ti---[ -3 -[-------.--M- L


L-c�-8
Step 9 - Unclamp timer. Trans. to Step 1 0 after I sec.

Unclmp_Trnr
Step_9
TON

11 Timer On Delay

Timer T4:4

Time Base 0.01

Pres et 100

Accum o
Unclmp_Tmr/DN Run Step_lO

E 3 �
E -------r-
M ---1 L

L-c�-9
Step I O - Raise rotator. Trans to Step 1 1 when up.

Step _ 1 O ROTR UPLS Run Step_ 1 1

12 t----1 E-rl---E-
1-- J 1---E----...-
� ---! L

Lc�IO
Figure 6.24. (continued)
6.4 COMPLICATED RESET OPERATION 341

I Step 1 1 - Rotate CCW. Trans. to Step 1 2 when CCW. 1

Step_l l ROTR CCWLS Run Step_12

13
E J E 3 ---i°S--1
1--
[ L

Le�¡¡
Step 1 2 - Drop engine. Trans. to Step 1 3 when not up.

Step_12 PALL UPLS Run

14
- -E-H--3 E--------.-

Step 1 3 - Move out pallet. Trans. to Step 1 when time done.

Eng2_Tmr
Step_13 TON-----,

15 1--�--------------1 Timer On Delay

Timer T4:2

Time Base O.O!


D�
Preset 300

Accum o

Eng2 _Tmr/DN

I Engaging hooks control I

Step_2 ENGI_RET

Step_13 ENG2 RET

I Rotating mechanism up/down control I

Step_6 Run ROTR UP

18 .........- --1 �

Step�

RStep_2

ROTR DOWN

Figure 6.24. (continued)


342 Sequential Applications

Rotation control
1

Step_7 Run ROTAT CW

20
E ]
Step_ll Run ROTAT CCW

21
E J E e

I Gripper control

Step_5 GRIP CLOS

22 1-T----i

Step_8

I Pallet up control I

Step_3 PALL UPCTL

23 1-T----i

Step_5

Step_7

Step_9

Step_ll

Figure 6.24. (continued)


6.4 COMPLICATED RES ET OPERA TION 343

Start/stop for reset operation. Reset pb starts, reset step 4 stops it.

RESET PB Run RStep_4 Int Reset

24
H H-----(
Int�+'
I First press of reset pb starts reset. l

RStep_l RStep_2 RStep_3 RStep_4 RStep_l

25
H H H H-----1(L

Reset Step 1 - Delay to unclamp. Transition to Reset Step 2 when done.

RUnClmp_Tmr
RStep_l
TON-----,

26 t---.---------------1 Timer On Delay

Timer T4:5

Time Base 0.01


D�
Preset 100

Accum o
RUnClmp_Tmr/DN RStep_2

...______, i--
[ ----�loS--1 L

�-----------------��-¡

Reset Step 2 - Raise mechanism. Trans. to Reset step 3 when up.

RStep_2 ROTR UPLS RStep_3

27 t---t t-E---lrt--E----�1oS-- L
��-2

Reset Step 3 - Rotate CCW. Trans. to Reset step 4 when CCW.

RStep_3 ROTR CCWLS

zs E J E-----------.------1
,__

Transition out ofReset Step 4 when interna! reset unlatched.

RStep _4 Int Reset RStep _4

29 -1 �H������-cu
I Reset steps of main operation

Int Reset Step_l

30

11��'
i""'v

Figure 6.24. (continued)


344 Sequential Applications

Step_3

u
Step_4

u
Step_S

u
Step_6

Figure 6.24. (continued)

Start/stop/pause of normal operation

First start of normal operation

Transitions between steps

Step actions

Reset operation transitions

The start and transitions for the reset operation (rungs 24 - 29) are handled similarly as

for the normal station operation. The last step (step 4) of the reset operation is used to

unlatch the Int_Reset coi! which is on as long as the reset operation is in progress. The reset

steps are used as conditions to tum on the rotation mechanism up and rotate controls (rungs

1 8 and 2 1 ) .

The Allen-Bradley ControlLogix ladder logic code is nearly identical to the PLC-5

code in Figure 6.24. The only difference occurs in the timers. The "Time Base" field is

absent and the Preset value is multiplied by 1 0 (Contro!Logix time base is 1 ms). Also, the

timer tag appears in the Timer field of the TON instruction, replacing the address in the

PLC-5 TON instruction.

The Siemens S7 ladder logic code looks most similar to the Modicon ladder logic code.

Rather than show the entire S7 ladder logic, only rungs 3-8 are shown in Figure 6.2 5 . The

GE Fanuc ladder logic is also similar to the Modicon Concept ladder logic. Rather than

show the entire ladder logic for the GE Fanuc PLC, only rungs 3-9 are shown in Figure 6.26.
6.4 COMPLICATED RESET OPERA TION 345

Step 1 - Wait for pallet. Trans. to Step 2 when pallet present.

"Step_l" "PROX" "Run" "Step_2"

3
1
l l
t------tl �p��

YRH
Step 2 - Move to hook 2. Trans. to Step 3 when engaging 1 hook open 2 sec.

"Engl_Tmr"

"Eng 1 _Trnr". Q "Step_3"


"TON"

4 EN ENO
"Step_2"

IN Q
��-�

T#2S PT ET

I Step 3 - Raise pallet. Trans. to Step 4 when up. 1

"Step_3" "PALL UPLS" "Run" "Step_ 4"

5
1
1--1-1 � s H

y�3H
Step 4 - Lower rotator. Trans. to Step 5 when down.

"Step_4" "ROTR DNLS" "Run" "Step_S"

6
1 1--1-1 � s H

"Step_4"

RH
Step 5 - Clamp engine. Trans. to Step 6 when timer done.

"Clmp_Tmr"

"Clmp_Trnr".Q "Run" "Step_6"


"TON"

71------�EN ENOt------l
1
"Step_S"

--� IN Q �-CH-�
T#ISSOOMS PT ET

Step 6 - Raise rotator. Trans. to Step 7 when up.

"Step_6" "ROTR UPLS" "Run" "Step_7"

8
1
1--1-1 � s H

Y�H
Figure 6.25. S7-300/400 ladder logic for engine inverter station (partial).
346 Sequential Applications

Step l - Wait for pallet. Trans. to Step 2 when pallet present.

Step_l PROXl Run Step_2

1 1 1 1 -
1 --u--tS
e
t:_

RH
Step 2 - Move to hook 2. Trans. to Step 3 when engaging l hook open 2 sec.

Step_2 Step_3
TMR

1--���---1TENTHS1--���������.--��
4
sH
Engl_Trnr

20 PV

I Step 3 - Raise pallet. Trans. to Step 4 when up. 1

----.-e--
Step_3 PALL UPLS Run Step_4

s 1 1 - 1 1 -1 sH
Step_3

RH
Step 4 - Lower rotator. Trans. to Step 5 when down.

----.-e--
Step_4 ROTR DNLS Run Step_5

6
1
1 - -1-1 -1 s H

Step_ 4

RH
I Step 5 - Clamp engine. Trans. to Step 6 when timer done.

Step_5 Clmp_Dn
TMR

7
1
TENTHS -�����-----t( H
1
Clmp_Trnr

15 - PV

Clmp_Dn Run

8
1 1 1

Step 6 - Raise rotator. Trans. to Step 7 when up.

----.-e-
Step_6 ROTR UPLS Run Step_7

9
1 1-1--1 -1 s H

Step_6

RH
Figure 6.26. GE Fanuc ladder logic for engine inverter station (partial).
6.5 P ARALLEL OPERA TIONS 347

6.5 PARALLEL OPERA TIONS

Suppose the gasoline engine manufacturer wants to increase the throughput of the

assembly line. Therefore, the cycle time of each station must be decreased. One way to meet

this requirement for the engine inverter station is to allow certain steps to happen

simultaneously. For example, the raising ofthe pallet (step 2) and the lowering ofthe rotator

(step 3) steps can occur simultaneously. The first part ofthis revised function chart (without

the actions) is shown in Figure 6.27. The double horizontal line indicates that both paths are

executed simultaneously.

On a function chart, two kinds of branching are allowed. If the transition out of a step

causes more than one step to be activated simultaneously, called simultaneous divergence

or AND branching, these simultaneous sequences are represented as in Figure 6 . 2 8 . The

double horizontal lines distinguish this type of branching. Also, only one common

transition condition is permitted above the top double horizontal line, and no transitions are

permitted below the upper double horizontal line. When step 1 1 is active and the condition

" X V l l O Closed" is true, then step 11 becomes inactive and steps 1 2 , 1 4 , and 1 6 become

active simultaneously. The sequences converge with a double horizontal line having a

common transition symbol under the double horizontal line. Step 1 8 w i l l become the active

step only when ali the steps above the double horizontal line are active and the transition

condition "XV20 l A Closed .and. XV202A Closed .and. XV203A Closed" is true. For sorne

systems, especially those that involve mechanical motion, the simultaneous steps do not

finish at the same time. In this situation, an extra step must be added before the branch

convergence (lower double horizontal line). This step serves to stop the motion and to wait

for the other parallel steps to finish. This issue is considered in Example 6 . 5 .

A selection of one sequence out of more than one sequence is called exclusive

divergence or OR branching and is represented by multiple transitions below the single

horizontal line, as shown in the upper part of Figure 6.29. Each possible sequence path

contains a transition condition. No common transition condition is permitted above the

horizontal line. The exclusive divergence is differentiated from the simultaneous

AllowNext
Step_2
One In

Engl_Tmr done

Lower
Step_3 Raise Pallet 4
Step_ Rotator Mechanism

PALL UPLS .and. ROTR DNLS


- -

.and. Run

Step_5 Clamp Engine

Figure 6.27. Example parallel steps.


348 Sequential Applications

Close
Step_l 1
XVllO

X V I I O Closed

XV201B XV202B XV203B

�� �� o�

XV201A Closed .and. XV202A Closed

.and. XV203A Closed

Open
Step_18
XV326

Figure 6.28. Example of simultaneous divergence (AND branching).

divergence by the single horizontal line. If step 5 is active and the tank is full, then there are

three possible transition conditions. Ifthe "Path 1 " condition is true, then the logic advances

to step 6. Otherwise, if"Path 2" is true, then the logic advances to step 8, or if"Path 3" is

true, the logic advances to step l O. In order to select only one succeeding step, the transition

Fill Tank
Step_S

Tank Full Tank Full Tank Full

.and. Path 1 .and. Path 2 .and. Path 3

XVIOIA XVlOlB XVIOIC

Open Open Open

XV102A XV102B XV102C

Closed Closed Closed

Open
Step_12
XV103

Figure 6.29. Example of exclusive divergence (OR branching).


6 . 5 PARALLEL OPERA TIONS 349

conditions must be mutually exclusive. The several sequences must also converge to a

common sequence, as in the lower part ofFigure 6.29. There must be as many transitions

above the horizontal lineas sequences to be re-grouped. No common transition condition is

permitted below the lower horizontal line. If step 7 is active and "XV l 02A Closed" is true,

or if step 9 is active and "XV102B Closed" is true, or if step 11 is active and "XV102C

Closed" is true, then step 1 2 becomes the active step.

Both types of branching can be combined on the same function chart as shown in

Figure 6.30. Note that the beginning and ending of each branch must correspond. A

simultaneous divergence (double horizontal line) cannot be finished with an exclusive

divergence (single horizontal line).

Initial

Run

Heat
Step_l
TlOOO

T l OOOTemp >= 1 0 0

ProductA ProductB

Fill lng. A Fill lng. B Agitate


Step_2 Step_3 Step_4
andX andX TlOOO

TlOOOLev TlOOOLev

>= 80 >=90

Heat
Step_5
TlOOO

Agit time done

Step_6

T l OOOTemp <= 40

Dump
Step_8
TlOOO

T l OOOLev <= 1

Figure 6.30. Example combined types ofbranching.


350 Sequential Applications

The code to handle the transitions for the simultaneous divergence in Figure 6.28 is

shown in Figure 6 . 3 1 . The exclusive divergence of Figure 6.29 is handled in ladder logic

code as shown in Figure 6 . 3 2 .

Step 1 1 - Close XVI 1 0 . When closed, transition to Steps 12, 14, 16.

Step_ll XVIIO Closed Step_12

15 1 1 - -------.......--- s --,--l

Step_14

s
Step_l6

s
Step_ll

Step 1 2 - Open XV 2 0 1 B . When open, transition to Step 1 3 .

Step_l2 XV201B_Open Step_13

16 1 1 -1----------.
� -- s

ye�12

Step 1 4 - Open XV202B. When open, transition to Step 1 5 .

Step_l4 XV202B_Open Step_l5

17 1 1 1-----------.
� -- s

ye�l4

Step 1 6 - Open XV203B. When open, transition to Step 1 7 .

Step_l6 XV203B_Open Step_17

18 1 1 -1----------.
� -- s

ye�l6

I Transition to Step 1 8 when XV201 A, XV202A, and XV203A closed. 1

Step_13 XV201A_Cls Step_l5 XV202A_Cls Step_l7

19
1 1 1 1 1 1 1 1 Ht
XV203A_Cls Step_l 8

¿¿--1 ---...---4 s
Step_13

Step_l5

Step_17

Figure 6.31. IEC ladder logic for example simultaneous divergence ofFigure 6.28.
6.5 PARALLEL OPERA TIONS 351

Transition from Step 5 to Step 6, 8, or 1 O - Open val ves

Step_5 Tank Full Step_5

9 ,_____, -1-------1 - .___ __,¡ R 1------1

Path 1 Step _6

-1--1-( s
Path 2 Step_8

l (s
Path 3 Step_lO

-1--
1 -( s

I Step 6 - Open X V I O l A . Transition to Step 7 when open. 1

Step_6 XVIOlA_Open Step_7

10
1 1 1--
1------d---1 s
Ste;_6

Step 8 - Open X V 1 0 1 B . Transition to Step 9 when open.

Step_8 XVIOIB_Open Step_9

1 1 1 1 i--
1 -----�d--------f s
Ste;_8

I Step 1 0 - Open X V I O l C . Transition to Step 1 1 when open. ¡

Step_lO XVIOIC_Open Step_ll

12 1 1 -1 -----�M- s
L-�t�lO

Transition to Step 1 2 when appropriate path valve closed.

Step_7 XV102A Cls Step_12

13
s ....__ ____.
1 1

Step_9 XV102B Cls Step_7

R
1 1

Step_l l XV103C Cls Step_9

R
1 1

Step_l 1

Figure 6.32. IEC ladder logic for example exclusive divergence ofFigure 6.29.
352 Sequential Applications

Example 6.5. In order to decrease the cycle time of the engine inverter of Example 6.4,

certain steps occur simultaneously:

l. The "raise pallet" (step 2) and the "lower rotator" (step 3) steps occur

simultaneously.

2. After the engine is unclamped, the rotator is raised and rotated CCW ( steps 1 O and

1 1 ) while the engine is dropped and moved out (steps 1 2 and 1 3 ) .

Solution. For both simultaneous divergence parts ofthis example, one must consider if an

extra step must be added for each branch just before the convergence. For the first AND

branch, no extra step is needed. If the "raise pallet" step finishes first, the PALL_UPCTL

output continues to be activated while the rotator lowers, which is acceptable since the

PALL_UPCTL needs to be on until the engine is dropped back onto the conveyor. Ifthe

"lower rotator" step finishes first, the ROTR_DOWN output continues to be activated,

holding it against the mechanical stop, which is also nota problem since it should be a short

time. The "raise pallet" should finish first, since this motion travels a shorter distance. The

second AND branch requires an extra step before the convergence. The "move out pallet"

step must complete, even when the operation is paused. The "wait" step allows the

ENG2_RET output to be tumed off when the operation is paused while the rotator is

moving. The extra step after the "rotate counterclockwise" step is not necessary, but it does

make sure the ROTR_CCW output is offwhile the engine is moving out.

The revised function chart for the station is shown in Figure 6 . 3 3 . Note the extra wait

steps added to the second simultaneous divergence. Also, with the wait steps (Step_l2 and

Initial

Run

PROX 1 .and. Run

Allow Next ENGI RET


Step_2
Oneln Engl_Tmr = 2 s

Eng l _Tmr done

PALL UPCTL ROTR DOWN


Step_4

PALL UPLS .and. ROTR DNLS .and. Run


- -

Figure 6.33. Function chart for revised engine inverter. (continued)


6.5 PARALLEL OPERATIONS 353

PALL UPCTL
Step_5 Clamp Engine
GRIP CLOS

Clmp_Tmr = 1 . 5 s

Clmp _Tmr done .and. Run

PALL UPCTL
Raise
Step_6
GRIP CLOS
Rotator
ROTR UP

ROTR UPLS .and. Run

PALL UPCTL
Ro tate
Step_7
GRIP CLOS
Clockwise
ROTAT CW

ROTR CWLS .and. Run

Lower PALL UPCTL


Step_8
GRIP CLOS
Rotator
ROTR DOWN

ROTR DNLS .and. Run

Unclamp PALL UPCTL


Step_9
Engine Unclmp_Tmr = 1 s

Unclmp_Tmr .and. Run

Raise ROTR UP
Step_lO Step _ 1 3 Drop Engine
Rotator

ROTR UPLS .and. Run /PALL UPLS .and. Run

ROTAT CCW ENG2 RET


Step_l l Step_l4
Eng2_Tmr=3 s

ROTR CCWLS .and. Run Eng2 _Tmr done

Step_l2 Wait Step_l5 Wait

Step_l2 .and. Step_l5 .and. Run

Figure 6.33. (continued)


354 Sequential Applications

Step _ 1 5 ) , the transition condition out of the convergence of steps 1 2 and 1 5 uses the

step-in-progress bits of the wait steps instead of the ROTR_CCWLS input and Eng2 _Tmr

done interna) coil.

The Modicon ladder logic code for the transitions is shown in Figure 6 . 3 4 . The code for

the reset operation and the physical outputs is the same as rungs 1 6 - 30 ofFigure 6.23 with

the exception that the contact labeled "Step _ 1 3 " in rung 1 7 is replaced by "Step _ 14".

Start/stop/pause. Start prevented if reset in progress

START PB Int Reset STOP PB Run

1 1 / - 1-.--.1 -1 ���--o-
Run

Generate transition out of initial step

Run Step_l Step_2 Step_3 Step_4 Step_5 Step_6 Step_7

2
H/H/H/H/H/H/H/Ht
Step_8 Step_9 Step_lO Step_l l Step_12 Step_13 Step_14

tHIH/H/H/H/H/H/Ht
Step_15 Step_l

tHI�
Step 1 - Wait for pallet. Trans. to Step 2 when pallet present.

Step_l PROXI Run Step_2

3
1
1 1--1 -1-----.--
� - s

Y§}-
Step 2 - Move to hook 2. Trans. to Steps 3&4 when engaging 1 hook open 2 sec.

Engl_Tmr

Step_2
TON

4 i--------1 IN Q i------------,.-----1

t#2s PT ET

Figure 6.34. Modicon ladder logic for transitions of revised engine inverter station.

(continued)
6.5 PARALLEL OPERA TIONS 355

When pallet raised & rotator lowered, transition to Step 5 .

Step_3 PALL UPLS Step_4 ROTR DNLS

s - -.....
-1-1 -1-1 --1----ti --1 -----t

Step 5 - Clamp engine. Trans. to Step 6 when timer done.

Clmp_Tmr

Step_5 Run
TON

6 i-------i IN Q i-------1

t# I . S s PT ET

Step 6 - Raise rotator. Trans. to Step 7 when up.

Step_6 ROTR UPLS Run Step_7

7
--1-1-1-1 -1---�s-


Step 7 - Rotate clockwise. Trans. to Step 8 when clockwise.

Step_7 ROTR CWLS Run Step_8

8
1
1 - -- 1-1 -1---�-s


Step 8 - Lower rotator. Trans. to Step 9 when down.

Step_8 ROTR DNLS Run Step_9

9
--1-1- --1-1 -1----r--
� s-

Step 9 - Unclamp timer. Trans. to Step 1 0 & 1 3 after 1 sec.


L+
Unclmp_Tmr

Step_9 Run

10
1
Wlj�TONE�l 1

Figure 6.34. (continued)


356 Sequential Applications

I Step I O - Raise rotator. Trans to Step 1 1 when up. ¡

Step_lO ROTR UPLS Run Step_ll

11 1 1 - 1 1 -
1 --......-
� -s

I Step 1 1 - Rotate CCW. Trans. to Step 1 2 (wait) when CCW.

Step_ll ROTR CCWLS Run Step_12

12
1
1- -1-1 -1--..........-
� - s

Step 1 3 - Drop engine. Trans. to Step 1 4 when not up.

Step_l3 PALL UPLS Run Step_14

13
1
1 7 1 --1 -1------.--
� -- s

Step 1 4 - Move out pallet. Trans. to Step 1 5 (wait) when time done.

Eng2_Tmr

Step_l4
TON

14 i--------1 IN Q t------------,....---1

t#3s PT ET

I Transition to Step 1 - Wait for pallet

Step_12 Step_l5 Run

15
-1-11-1

Rungs 1 6 - 29 identical to those in Figure 6.23

Rung 30 also resets Step_l4 and Step_l5

Figure 6.34. (continued)


6.7 MANUAL AND SINGLE-STEP SEQUENTIAL OPERATION 357

6.6 KEY QUESTIONS IN THE SEQUENTIAL DESIGN PROCESS

The examples in this chapter illustrate a simple method of programming sequential

operations. The major part ofthe method is to develop a function chart ofthe operation:

1 . Identify the steps and transition conditions.

2. Add step actions.

After the first draft of the function chart is developed, other key questions to ask:

Does the operation repeat?

If it does not repeat, then the last step may need to reset (unlatch) the

operation run status.

How is stop/pause handled?

Identify those physical outputs that must be off when paused.

Identify the timers that must retain their accumulator value.

Does pause prevent transitions?

Ignored in certain steps?

Does stop cause reset (or emergency stop)?

How is reset handled?

Reset only allowed when already paused?

Is there another sequential operation that must occur when the system is

reset, to bring it back to an initial state?

6.7 MANUAL AND SINGLE-STEP SEQUENTIAL OPERA TION

Up to this point, the control of a sequential machine has assumed mostly continuous

operation. The operator can start and stop/pause the operation and reset it to the first step.

This mode of operation typically called the auto mode. However, when devices

malfunction, there are two other modes of operation that are also useful. The first is the

ability to single-step the operation. When in the single-step mode and the conditions to the

next step are met, the program waits for the operator to press a "Continue" button in order

for the operation to advance to the next step. The single-step mode allows personnel to

monitor the operation of each step individually. The second mode that is useful is

completely manual operation. In this mode, the operator may individually manipulate the

physical outputs. Of course, a push button must be provided for each manipulated physical

output.

The operator panel for this three-mode control of the machine operation is shown in

Figure 6 . 3 5 . The mode switch is a three-position selector switch. The other switches are ali

push button switches. The switches required for manual manipulation of the physical

outputs are not shown.

In the single-step mode, the start/stop push buttons function the same as in the auto

mode. When in the single-step mode, pressing the stop button pauses the operation. When

paused, the start button must be pressed before pressing the continue button.

The transitions between modes are handled as follows:

Auto to Single-step: Operation completes the current step and then pauses, waiting

for the "Continué" button to be pressed. The state of the Run coi! does not change.
358 Sequential Applications

AUTO
START STOP
SINGLE
MANUAL
STEP

CONTINUE
º º
RES ET

o o
Figure 6.35. Operator panel far three-mode control.

Single-step to Auto: Operation will resume from the current step. The state ofthe Run

coi! <loes not change.

Auto to Manual: Operation pauses at the current step (like the stop switch was

pressed). The Run coi! is tumed off.

Manual to Auto: Operator must also press the Start button to resume automatic

operation at the step from which it was switched to Manual. Ifthe operation must

resume from the first step, the Reset button must be pressed befare the Start button

is pressed.

The single-step and manual modes are easily added to the sequential operation. The

ladder logic is modified as follows:

1 . The start/stop rung is modified to disable the Run coi! when in manual mode.

2. Auto and single-step mode logic is added in series with the step transition logic.

3. Manual mode logic is added in parallel to the conditions driving the physical

outputs.

When adding the single-step and manual logic to the ladder logic, particular attention

must be paid to those physical outputs that must be tumed offwhen sorne physical limit is

reached. For example, the command to extend a double-acting pneumatic cylinder may

need to be tumed off when the cylinder is fully extended, even while the operator is still

pressing the "Extend" button in manual mode or befare the "Continué" button is pressed

when in single-step mode.

Example 6.6. Add three-mode control to the engine inverter of Example 6.4. Four

additional physical inputs are required:

Variable Description

AUTO Mode selector switch in "Auto" position.

MANUAL Mode selector switch in "Manual" position.

SSTEP Mode selector switch in "Single Step" position.

CONTINU Single-step mode continue push button, N. O., on transition

causes transition to the next step when other transition

conditions met and in single-step mode.


6.7 MANUAL AND SINGLE-STEP SEQUENTIAL OPERATION 359

Start/stop/pause. Start prevented if reset in progress or in manual mode

START PB Int Reset STOP _PB,- "MANUAL , Run


_ _ _ _
1 1 I ,____,____.... 1 \ 1 I -,..
1� ' --o-
Run

(a)

I Transition to Step 2 - Move to hook 2 1

Step_HROHRun�ÁÚTO
,.. '
4
'
I

: SSTEP CONTINU

', 1-IP
' ....

(b)

I Rotating mechanism down control L

;, - -
Step_4 Run /'" ÁUTO , ROTR DOWN

19

Step_� �STEP ROTR D�S

�-/ _ _ ; Y
I
---1----117

1
MANUAL M RTDN ROTR DNLS I
1

I l 1 1 7 _ ,..

- - - - - - - - - - - -
(c)

Figure 6.36. IEC (Modicon) ladder logic changes for three-mode control (partial):

(a) start/stop rung; (b) transition to step 2; (e) ROTR_DOWN control.

Solution. Rather than giving a complete solution to this problem, the following changes to

the ladder logic ofFigure 6.23 are shown in Figure 6 . 3 6 :

Start/stop, rung 1 (Figure 6.36a)

Transition to step 2, rung 4 (Figure 6.36b)

Rotating mechanism down control, rung 1 9 (Figure 6.36c)

The dashed lines indicate the changes to the original ladder logic.

In rung 1 9 , M_RTDN is an operator manual push button to move the mechanism. Also

note that for both the single-step and manual modes, the control to move the mechanism

down is tumed off as soon as the ROTR DNLS limit switch tums on.
360 Sequential Applications

6.8 TRANSITIONS WHEN PLC HAS NO SET/RESET

Ifthe PLC does not have set/reset or latch/unlatch instructions (e.g., Modicon x84 and

Siemens TI-5x5) then the step-in-progress bit for each step is handled like a normal

start/stop rung, shown in Figure 6 . 3 7 . The start condition is the previous step and the

transition condition. The stop condition is the step-in-progress bit of the next step. The

Int_Reset contact also functions as a stop and is used to restore the steps to the initial state in

the same manner as unlatching ali step-in-progress coils in previous examples in this

chapter. The disadvantage of this approach is that the step-in-progress bits of successive

steps overlap by one sean, thus the physical outputs may overlap by one sean. For example,

the ladder logic rungs in Figure 6 . 3 8 a will have a timing diagram like Figure 6.38b when

LS2 el oses to cause a transition from Step _8 to Step _9. Each application must be examined

to determine ifthis overlap is acceptable. A simple way to remove the overlap is to insertan

extra step between each step. This extra step overlaps the prior step and the succeeding step,

and it eliminates the overlap between the prior and succeeding steps. For example, the

ladder logic in Figure 6 . 3 8 a can be modified as shown in Figure 6 . 3 9 a . Figure 6 . 3 9 b shows

the timing diagram for a transition between steps 8 and 9. Other approaches that avoid

step-in-progress coil overlap are covered in Chapter 9.

The Modicon Concept Jadder logic without set/reset instructions for the tub loader of

Example 6.2 is shown in Figure 6.40. Note that the first start of the operation must be

handled as shown in Figure 6.9a.

6.9 CHAPTER SUMMARY

This chapter presents a technique for designing Jadder logic programs to control

sequential processes. The technique is based on describing the operation as a function chart

and then translating the function chart to ladder logic code. The ladder logic uses the basic

contact and coi! instructions. Timers and counters are used only when explicitly needed by

the operation. The ability to pause and reset an operation is also considered. The design of

programs for operations with parallel steps and for operations that need single-step and

manual control is examined. Since the design technique uses the set/reset instructions, the

last section presents an altemate implementation using only the ordinary output coi! that

may be used for PLCs that do not have the set/reset coil instructions.

Previous _Step Transition Condition lnt Reset Current_Step

1
1 �-/1---I -e

Current1-
_ st_eP
_ N--1el/ S

Figure 6.37. Non-latching step.


6.9 CHAPTER SUMMARY 361

Step_7 LS 1 Int Reset Step _8

1 1 � / l t-----(

Step_
.....
l 8----isli µ

Step_8 LS2 Int Reset Step _9

1
1 � / t-- 1---(

Step_9 Step_lO

-----1---11/

(a)

Sean
Number 30 32 34
.

. .

l _j ¡
• 1

LS2 1

o . �

. . .

1 ---------·
Step_8 . . ::

o ··----------

1
:
�---- - - - - -
1 1 1 1
- --- 1

Step_9 1

O --7--7'

Time

At I/0 Terminal ---­

In PLC Memory • • • • • • • •

(b)

Figure 6.38. Two overlapping steps: (a) ladder logic; (b) transition from Step_8 to Step_9 . .
362 Sequential Applications

Step_7 LS 1 Int Reset Step_8

1
I ÉJ / 1 ----(

Step_8 Step_8A

-1-1/

Step_8 LS2 Int Reset Step_8A

1
(
l � / 1

Step_l1-A--sl¡-� ·

Step_8A Step _8 Int_Reset Step_9

1
(
I / ÉJ / 1

Step_9 Step_9A

-1-1/
(a)

Sean
Number 30 32 34

LS2

1 - - -:i - - -:i · - � ·
Step_8
• 1
, ,
1
.. _
o

, 1 - - :- - - :¡

' 1 ' • I
Step_8A
1 1

o ------· ·-------·

• 1 • • •


----------
1
Step_9

o - - - - - - - - - .!
Time

At 1/0 Terminal ---­

In PLC Memory • • • • • • • •

(b)

Figure 6.39. Extra step to eliminate overlap in steps: (a) ladder logic; (b) transition from

Step_8 to Step_9.
6.9 CHAPTER SUMMARY 363

Generate transition out of initial step

Run Step_l Step_2 Step_3 Step_4 Step_S ,

H/H/H/H/HIHt
Step 6 Step 7 First Start

tHI-H/l-ó--

j Step 1 - Parts drop into tub

First Start Int Reset Step _ l

2 t---------r-------/r--0---
Step_7 GATE2 CLLS Run

1 1 1 1

Step_l Step_2

1 1 /

Count parts during step 1 . Transition to Step 2 - Open Gate 1

Part_Ctr

Step_l PE272 Part Ctr Dn


CTU INT

3 cu Q t------------1
-
1 -1/

Step_2

100 PV cv

j Step 2 -Open Gate I


1

Step_l Part Ctr Dn Run lnt Reset Step _2

4
1 r r 1
i-------r---1
1
/ r--0----
Step_2 Step_3

1 1 / 1

j Step 3 - Hold gate I open

Step_2 GATEI_OPLS Run lnt Reset Step_3

5
1 1 1 1
i---.------11
1
/ r--0----
Step_3 Step_4

1 1 / 1

Figure 6.40. Modicon ladder logic for transitions for tub loader with no set/reset output

instructions. (continued)
364 Sequential Applications

GlH Tic

I Delay prox. off during step 3.

GITic Tmr Gl Hold Tmr

Step 3 TUB PROX Run G1H Tic


TON CTU INT

IN Q 1- ......_ ----l C U Q
6
H1HH/
t#IOOms PT ET R
Step_4

PV CV

Gl Hold Dn

«----�
I Step 4 - Close Gate 1 1

Step 3 G1 Hold Dn Int Reset Step_4

7
l -1 �--�-----1/�
Stepl4 s{¡-1-s___.

I Step 5 - Open Gate 2 1

Step_ 4 GATEI CLLS Run lnt Reset Step_5

8 1- - -1
1 1 ---1 ----ti lt-----r---11 I�
Step_5 Step_6

-1---11 I --1____.

I Step 6 - Hold gate 2 open

Step_5 GATE2 OPLS Run lnt_Reset Step_6

9
1 1 --1 ----ti -1 ---.------ti/�
Step_6 Step_7

-1---11/1-----'
G2H Tic

I Delay prox. on during step 6.

G2Tic Tmr G2_Hold_Tmr

Step 6 TUB PROX Run G2H Tic


TON CTU INT

IN Q CU Q
10
H1H H/ 1--....._----1

t#IOOms PT ET R
Step_7

PV CV

Int Reset G2 Hold Dn

<�

Figure 6.40. (continued)


REFERENCES 365

j Step 7 - Close Gate 2 j

Step 6 G2 Hold Dn Int Reset Step_7

11
l -1 �-----r------1/�
Stepl7 s¡1¡-1-1____.

j Rungs 1 2 - 1 6 are identical to rungs 9 - 1 3 ofFigure 6 . 1 6

t steps, provide reset for counters

17
µ Reset

1
Run

1/-1------0-
Int Reset

Figure 6.40. (continued)

REFERENCES

GE Fanuc, 1999. Series 90™-30/20/Micro PLC CPU lnstruction Set: Reference

Manual, pub. GFK-0467L, GE Fanuc Automation North America, lnc., Charlottesville,

VA.

IEC, 1988. IEC 848: Preparation of Function Charts for Control Systems,

Intemational Electrotechnical Commission.

IEC, 1 9 9 3 . IEC 1 1 3 1 - 3 : Programmable Logic Controllers - Part 3: Programming

Languages, Intemational Electrotechnical Commission.

Rockwell Automation, 1 9 9 8 . PLC-5 Family lnstruction Set Reference Manual, pub.

1 7 8 5 - 6 . 1 , Rockwell Automation, Milwaukee, Wl.

Rockwell Automation, 2002. Logix5000™ Controllers General Jnstructions, pub.

l 756-RM003F-EN-P, Rockwell Automation, Milwaukee, WI, May.

Schneider Automation, 1 9 8 8 . Concept Block Library IEC, vol. 1 , ver. 2 . 1 , pub. 840

USE 462 00, Schneider Automation, Inc., North Andover, MA.

Siemens, 2002a. Ladder Logic (LAD)for S7-300 and S7-400 Programming: Reference

Manual, Edition 1 1 / 2 0 0 2 , pub. A5EOOl 7 1 2 3 l - O l , Siemens AG, Nuemberg, Gennany.

Siemens, 2002b. System Software for S7-300/400 System and Standard Functions:

Reference Manual, Edition 12/2002, pub. A5E00171234-0l, Siemens AG, Nuemberg,

Gennany.

You might also like