D IVERGENCES AND C ONVERGENCES

D IVERGENCES AND C ONVERGENCES

So far, we have only discussed sequential function charts that have one link between their steps and transitions. However, SFCs can have multiple links between these program elements (see Figure 10-47). These multiple links can

be one of two types: • divergences

(b) Figure 10-47. An SFC with (a) one link between the steps and transitions and (b)

(a)

multiple links between steps and transitions.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10

A divergence is when an SFC element has many links going out of it, while

a convergence is when an element has many links coming into it. Both divergences and convergences can have either OR or AND configurations, which relate to the Boolean logic operators of the same name.

OR Divergences and Convergences. Figure 10-48 shows an OR diver- gence , or single divergence, which connects one step to many transitions. An OR divergence allows an active step to pass its token to one of several steps via connecting transitions; thus, it “diverts” one step to several transitions. Although an OR divergence connects a step with several transitions, the step can only activate one of these transitions at a time. In other words, like an exclusive-OR (XOR) function, the transitions must be mutually exclusive, triggering only one transition. Depending on the IEC 1131-3 system, an OR divergence must have either mutually exclusive triggering signals (i.e., when one transition is ON, the others are OFF) or programmed logic that creates a mutually exclusive situation (i.e., only one divergence path can be triggered at a time). Some systems avoid multiple divergence paths by selecting either the left-most or right-most divergence if several triggering conditions occur at once. This prioritizes divergence path selection.

Figure 10-48. OR divergence.

Figure 10-49 shows an SFC with an OR divergence after step 1. Once step 1 is activated, either step 10 or 20 can be activated if either transition 1 or 2 is triggered. These two transitions have mutually exclusive triggering condi-

OR Divergence 1 2 (one step to several transitions)

OR Convergence (several transitions to one step)

Figure 10-49. Example of an OR divergence and an OR convergence.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10

tions, so that the token advances in only one branch of the divergence. Therefore, if transition 1 is triggered, step 10 becomes active; if transition 2 is triggered, step 20 becomes active.

An OR convergence, also called a single convergence, is used to link several transitions to the same step (see Figure 10-50). An OR convergence is the opposite of an OR divergence; it “converges” several transitions to one step. Referring to Figure 10-49, this SFC illustrates an OR convergence in addition to an OR divergence. The OR convergence indicates that either of two links, one containing transition 11 and the other containing transition 30, can pass the control token to step 12. Because of the mutually exclusive requirement of the transition triggers, OR convergences and divergences are well suited for programming alarm circuit SFCs like the one shown in Figure 10-51. In this program, if the circuit is working properly after initialization, the program will begin the control sequence (transition 1 to step 20); whereas if an error occurs, the program will initiate an alarm action (transition 2 to step 30), which will sound an alarm until the alarm acknowl- edgment is triggered (transition 30). From step 1, the program can pass the token through only one path (either transition 1 or 2), but not both, because of the logical mutual exclusivity of the OR programming.

Figure 10-50. OR convergence.

1 Initialize

1 Run AND Not_Error

2 Error

20 Start_Motor_M1

30 Alarm

20 M1_Started

30 Acknowledge

21 Start_Run 21 Time_Up

22 Stop_Motor_M1 22 M1_Stopped

Figure 10-51. An alarm circuit with an OR divergence and an OR convergence.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10

AND Divergences and Convergences. An AND divergence, also called a double divergence , provides a link from one transition to many steps in parallel form (see Figure 10-52). Unlike an OR divergence, an AND divergence can pass the token through several branches at once. For example, if transition 1 in Figure 10-53 is triggered, the program will pass control to both step 40 and step 50 at the same time. The parallel lines that represent an AND convergence indicate that it passes control to all the steps below it in parallel.

Figure 10-52. AND divergence.

AND Divergence (one transition to several steps)

AND Convergence 2 (several steps to one transition)

Figure 10-53. Example of an AND divergence and an AND convergence.

An AND convergence, also referred to as a double convergence, links multiple steps to a single transition (see Figure 10-54). It is most commonly used to group SFC branches that were separated by an AND divergence. Referring to Figure 10-53, once steps 41 and 51 both have the token (i.e., their actions are ON), the SFC program will wait for transition 2 to trigger and then pass the control token to step 10. This is an AND convergence function

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10

Figure 10-54. AND convergence.

because both steps 41 AND 51 will be deactivated by the transition. If more than two links converge at the transition, then all the steps immediately preceding the convergence must be active before the transition can occur. When it does occur, all the steps will converge to the step following the transition. For example, if only step 51 is active and transition 2 occurs, the SFC will not pass control to step 10. When both steps 41 and 51 are active and transition 2 is TRUE, then control will pass to step 10.

AND divergences and convergences are ideal for running control programs in a synchronized, parallel manner. For example, Figure 10-55 illustrates a sequential function chart depicting two processes that occur in parallel (at the same time). When transition 1 becomes active, it diverts activity to two program sections, each controlling one of the processes. Each program section, Process1 and Process2, must be completed (steps 21 and 31 active) before transition 2 can occur, transferring control back to step 1. Note that in an SFC transition like transition 2, which has the trigger variable True, the transition is always triggered. When used in an application, this type of AND convergence transition simply waits for both processes to finish before transferring control to the next step.

1 Initialize 1 Run

20 Process1

30 Process2

20 End_of_Process1

30 End_of_Process2

21 Wait_for_Process2

31 Wait_for_Process1

2 True

Figure 10-55. An SFC using AND convergences and divergences to run two

processes in parallel.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC The IEC 1131 Standard and C HAPTER 3 Programming

Programming Language 10