SFC F O R M AT

SFC F O R M AT

Sequential function charts represent the order of events in a sequential process. An SFC divides a process into many steps, which are represented by various graphic components (see Figure 10-28). All of these components are used to form one or more charts that comprise the complete control program.

Initial Step

Beginning Macrostep

Transition

Ending Macrostep

Jump to a Step

OUT

Figure 10-28. Graphic symbols used in SFCs.

Figure 10-29, for example, illustrates a small control program composed of three SFCs, each with its own independent initial step. By having indepen- dent steps, the control program starts scanning all of these charts when it first begins program execution, providing a parallel beginning. Chart 3

Figure 10-29. Three SFCs representing a control process.

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

also has a macrostep, which can be considered to be a subroutine or subprogram chart, but its initial step (IN step 30) is not independent. Chart 2 has a different link representation than charts 1 and 3 between its last step (12) and its first step (10), meaning that instead of using an arrow to link these steps, it uses jump instructions. The jump to instruction, programmed after the last step, uses an X followed by the step number to specify which step to go to—in this case, step 10. The jump from instruction, which is pro- grammed before the initial step, uses a Y and the transition number (i.e., Y12) to indicate where the jump is from. This Xstep number and Ytransition number notation is used throughout SFCs to distinguish between step and transition variables. Some 1131-3 systems use the letters S and T to denote steps and transitions, respectively, instead of the letters X and Y.

Sequential function charts are classified by levels, depending on how much detail they show. The SFC representations in Figure 10-29 are level 0 charts, because they do not specify any of the actions in their steps and do not define their transitions. Level 1 and level 2 charts (see Figure 10-30) show the actions associated with their steps. A level 1 chart represents its actions with names, comments, or descriptions of the control action executed in each step. It may also describe what occurs in each transition, or it may show the transition conditions in ST, along with the variables that will trigger them. A level 2 chart actually shows the instructions (in LD, FBD, ST, or IL) that implement the control action. In addition, it may specify an action description name like the ones used in level 1 charts; however, this name is shown in parentheses to avoid confusion with the instruction programming.

12 Start_Batch (a) Level 1

12 Batch_Complete

12 (Start_Batch) Level:=Switch_Level

Structured If Level Then Motor:=True

Text

(b) Level 2

Batch_Time:=t#8M Tstart (Batch_Time)

12 (Batch_Complete) Batch_Time ≥ Timeout

Figure 10-30. (a) Level 1 and (b) level 2 sequential function charts.

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

Each step and transition in an SFC has an ON status or condition if it is active and an OFF status if it is inactive. A dot, or token, indicates the ON/ OFF status of a step or transition. As illustrated in Figure 10-31, the dot in the step 11 block indicates that the step is active, meaning that the status of X11 is ON. Some manufacturers refer to the ON/OFF status of a step or transition as its Boolean activity or Boolean attribute because of the TRUE/FALSE nature of the signal activity.

10 Condition X10

10 Condition Y10 11 Condition X11

11 Condition Y11

Figure 10-31. The dot in step 11 indicates that it is ON.

Figure 10-32a illustrates a step being activated by a transition, while Figure 10-32b shows a step being deactivated by a transition. As shown in the timing diagram in Figure 10-32a, Y9 and X10 are both FALSE during time a1 because the Y9 transition has not occurred and, therefore, has not passed the token to step 10 (i.e., activated it). Once a condition or variable triggers transition Y9 (turns it ON), step 10 becomes active and the step condition X10 becomes TRUE. In Figure 10-32b, the timing diagram shows that step

12 is active (X12 is ON) during time b1 and becomes deactivated the moment transition Y12 turns ON at time b2.

a1—Step

a2—Step is active

X10

not active

after transition

b1—Step 1 b2—Step is not Y12

is active

active after transition

Figure 10-32. (a) An inactive step activated by a transition and (b) an active step

deactivated by a transition.

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

E X AM PLE 1 0 -4

Figure 10-33 shows an SFC in three different stages: (a) step 3 active, (b) step 4 active after being triggered by transition IN_1, and (c) step 4 turned OFF by the triggering of transition IN_2. Using a timing diagram, graphically illustrate the status of the steps (Xs) and the transitions (Ys) in each of these three phases.

Step 4 OFF Figure 10-33. Control being passed through an SFC.

Step 3 ON

Step 4 ON

S OLU T I ON

Figure 10-34 shows the timing diagrams for each of the three stages in Figure 10-33. When step 3 is active (with token), X3 is ON and its action will be executed. Once the transition IN_1 occurs (Y3 goes from OFF to ON), the token passes to step 4 for execution of its action; thus, X4 becomes ON. Step 4 will remain active (ON) until transition IN_2 (Y4) becomes TRUE, at which time, the control token will pass to the next step. Note that a transition does not need to remain ON once the token is passed to the next step down the chart. For example, the transition Y3 signal turned OFF immediately after passing the token to step 4; the dotted line in the timing diagram indicates this.

4 0 IN_2 4 IN_2 4 IN_2

Figure 10-34. Timing diagram for the chart in Figure 10-33.

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