anexo 09 grafcet using sequential funtion chart language

Upload: rafo-vega-guerovich

Post on 14-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    1/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-1

    15.0 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    The Sequential Function Chart (SFC) language is configured on a 128 x 128 cell grid called a networksheet. In the SFC language, configuration elements are connected together to perform a specific task; that

    group of elements is called a Sequential Function Chart. An example SFC is shown in Figure 15-1. Theelements permitted in an SFC include:

    Initial Steps

    Steps

    Transitions

    Expressions (Transition Statements)

    Actions

    Branches

    Comments

    Individual SFC elements are detailed in Sequential Function Chart(document number CG39-27).

    00001058

    Structured Text

    Statement

    TransistionBranch

    Initial StepStep Non-boolean Action Boolean Action

    Figure 151 Example Sequential Function Chart

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    2/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-2 July 2001

    15.1 SEQUENTIAL FUNCTION CHART EXECUTION

    Execution of a sequential function chart begins by determining which transitions are ready to be cleared.A transition can be cleared if all of the steps that flow into the top of the transition are active.

    After gathering the list of transitions that are ready to be cleared, each transition is tested to determine ifthe associated transition condition is TRUE. When a TRUE transition is encountered, all steps that flowinto the transition are de-activated and all steps that the transition flows into are activated.

    If a cleared transition is one of several that represent a Divergence of Sequence Selection (see section15.2.2), any remaining untested transitions, also within that Divergence of Sequence Selection, areremoved from the list of transitions to be tested.

    After all transitions in the list have either been tested or discarded, actions are executed. As with the

    function block diagram language, actions that have been de-activated during a scan are executed first,followed by those actions that are still active.

    15.2 RULES OF EVOLUTION

    The following subsections describe the rules of evolution for an SFC. When you read these descriptions,note that the following guidelines apply:

    There must always be alternating steps and transitions so that two transitions will never be linked.

    They must always be separated by a step.

    There are two different types of SFCs. These are the looped SFC and the terminated SFC.

    In a looped SFC, control evolves from the last transition back to the initial step. The looped SFCexecutes STEP1 again if the first transition condition is TRUE. The loop can be created bywiring the signal from the last transition back to the input of the initial step as shown in Figure

    15-2. The loop can also be made by either adding a last step with a non-boolean action thatpulses the charts reset variable to TRUE, or by using stubs to replace wiring.

    A terminated SFC ends with the last step as shown in Figure 15-3. A terminated SFC is not

    automatically reset like the looped SFC. Instead, it is reset by setting the charts reset variable fromoutside of the chart.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    3/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-3

    STEP1 N ACTION1

    STEP2 N ACTION2

    CHART01

    : = COND1 & COND2

    : = TRANS2

    : = - (COND1 & COND2)

    00001059

    Figure 152 Looped Chart

    STEP1 N ACTION1

    STEP2 N ACTION2

    CHART02

    : = COND1 & COND2

    : = TRANS2

    00001060

    Figure 153 Terminated Chart

    The following subsections defines allowable combinations of steps and transitions within an SFC. Forviewing clarity, the actions associated with each step are not shown in illustrations.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    4/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-4 July 2001

    15.2.1 Single Sequence

    In a Single Sequence, as shown in Figure 15-4, the evolution from STEP1 to STEP2 takes place only ifSTEP1 is active and the transition condition is TRUE. Steps and transitions are alternated in series.

    .

    .

    STEP2

    STEP1

    00001061

    Figure 154 Single Sequence Steps in an SFC

    15.2.2 Divergence of Sequence Selection

    In a Divergence of Sequence Selection, as shown in Figure 15-5, only one branch is taken. An evolution

    from STEP2 to STEP3 will only take place if STEP2 is active and the transition condition C is TRUE.An evolution from STEP2 to STEP4 will take place only if STEP2 is active, transition C is FALSE, andtransition D is TRUE. Note that a divergence is represented by transitions under the horizontal line. The

    transitions are evaluated from left to right.

    ..

    STEP4

    STEP2

    STEP3

    .. ..

    C D

    00001062

    Figure 155 Divergence of Sequence in an SFC

    15.2.3 Convergence of Sequence Selection

    In a Convergence of Sequence Selection, as shown in Figure 15-6, an evolution from STEP3 to STEP5

    occurs only if STEP3 is active and the transition condition E is TRUE. An evolution from STEP4 toSTEP5 occurs only if STEP4 is active and transition F is TRUE. A convergence is represented bytransitions above the horizontal line.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    5/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-5

    .

    .

    STEP4

    STEP5

    STEP3

    .

    .

    ..

    E F

    00001063

    Figure 156 Convergence of Sequence in an SFC

    15.2.4 Simultaneous Divergence of Sequence

    In a Simultaneous Divergence of Sequence, as shown in Figure 15-7, an evolution from STEP5 to STEP6and STEP7 occurs only if STEP5 is active and the transition condition G is TRUE. After thesimultaneous activation of STEP6 and STEP7, the evolution of each sequence proceeds independently.

    Only one common transition symbol is possible and it must be immediately above the double horizontalline. To emphasize the special nature of such transitions, the divergence of a simultaneous sequence isindicated by a double horizontal line.

    ..

    STEP7

    STEP5

    STEP6

    .. ..

    G

    00001064

    Figure 157 Simultaneous Divergence of an SFC

    An SFC using a Simultaneous Divergence of Sequence must also contain a matching Simultaneous

    Convergence of Sequence as described in the next section.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    6/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-6 July 2001

    15.2.5 Simultaneous Convergence of Sequence

    In a Simultaneous Convergence of Sequence, as shown in Figure 15-8, an evolution from STEP6 orSTEP7 to STEP8 occurs only if both STEP6 and STEP7 are active and the transition condition H is

    TRUE. Only one common transition symbol is possible, and it must be immediately below the doublehorizontal line. To emphasize the special nature of such transitions, the convergence of a simultaneoussequence is indicated by a double horizontal line.

    ..

    STEP7

    STEP8

    STEP6

    .. ..

    H

    00001065

    Figure 158 Simultaneous Convergence of a Sequence in an SFC

    An SFC using a Simultaneous Convergence of Sequence must also contain a preceding SimultaneousDivergence of Sequence as described in the previous section.

    15.2.6 Skip Sequence

    In a Skip Sequence, as shown in Figure 15-9, an evolution takes place directly from STEP30 to STEP33,

    skipping STEP 31 and STEP 32, if transition A is FALSE and D is TRUE. A sequence skip is when oneor more of the branches contain zero steps

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    7/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-7

    ..

    STEP32

    STEP30

    STEP31

    ..

    DA

    B

    C

    STEP33

    00001066

    Figure 159 Skip Sequence in an SFC

    15.2.7 Sequence Loop

    In a Sequence Loop, as shown in Figure 15-10, an evolution takes place from STEP32 back to STEP31 iftransition C is FALSE and D is TRUE. STEP31 and STEP32 are repeated. Note the careful placement of

    the T-connections so that no two transitions are in sequence. Also note that evolution through the Dtransition is in the down direction. The directed wire elements are provided to assist you in determining

    flow but they do not guarantee a direction of evolution. A Sequence Loop is when one or more of thebranches returns to a preceding step.

    4-mation has a built-in feature to detect unsafe or unreachable SFCs. Such charts are considered invalid.Examples of invalid charts are:

    An SFC with no initial step

    An SFC that does not end with a step.

    An invalid SFC is not be executed by the control module, but 4-mation displays it as it would display anyvalid SFC. In 4-mations on-line mode, no steps or actions are highlighted (shown as active) on an

    invalid chart.

    On a valid chart, every transition must have a preceding step and a successor step. (An exception is the

    steps in a terminated chart, where the initial step does not have a preceding transition, and the final stepdoes not have a successor transition.)

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    8/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-8 July 2001

    ..

    STEP32

    STEP30

    STEP31

    ..

    D

    A

    B

    C

    STEP33

    00001067

    Figure 1510 Sequence Loop in an SFC

    15.3 CHART MODES

    SFCs have five operating modes as detailed here:

    Off- This mode prevents the chart from executing and evaluating. No actions can be enabled by an SFCin this mode. Transition conditions are not evaluated.

    Auto - This mode permits the chart to run normally through its programmed sequence in full automaticoperation. Actions may be enabled by an SFC in this mode. Transition conditions can be evaluated.

    Manual - This mode allows you to manually evolve the chart. The chart runs its actions but no transitionsoccur until you manually force them. This is accomplished by using the Chart Control dialog box.Manual mode may be used, for example, when running a batch procedure. You may want to manually

    step through the remainder of a batch process due to problems with the batch equipment.

    Hold - This mode prevents an SFC from evolving. Actions may continue to execute, but transitions arenot evaluated. An example of when this mode can be used is when a pump is out of service for repairs

    and one of the actions calls for the pump to be started.

    Trace - This mode allows you to manually evolve the SFC. Actions are not be enabled by an SFC and

    transitions are not be evaluated. SFCs can be evolved using either the Chart Control dialog box or theCHRTMOD (Chart Mode) function block. Trace mode is helpful when debugging an SFC. If thestructure of the SFC is modified, such as adding steps, the SFC is reset to the initial step. To test one ormore new steps, the SFC can be manually stepped in Trace mode to the new step(s).

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    9/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-9

    Table 15-1 summarizes SFC evolution in each of the operating modes.

    Table 151 SFC Mode Evolution

    MODE ARE ACTION

    ASSOCIATIONS

    EVALUATED ?

    ARE ENABLED

    TRANSITIONS

    EVALUATED ?

    WILL A

    TRANSITION

    BE CLEARED

    IF POSSIBLE ?

    WILL THE TIME

    VALUE OF STEPS BE

    INCREMENTED ?

    Off No No No No

    Auto Yes Yes Yes Yes

    Manual Yes No Yes Yes

    Hold Yes No No Yes

    Trace No No Yes Yes

    15.3.1 SFC Control

    For each SFC, there are four variables that can be used to monitor its execution state.

    Mode - This variable is accessed by appending a .M to the SFC name (e.g. ChartName.M). It is an INT

    value from 0 to 4.

    where: 0 = Off1 = Automatic mode

    2 = Manual mode3 = Hold mode

    4 = Trace mode

    Reset - This variable is accessed by appending a .Rto the SFC (e.g. ChartName.R). It is a BOOL valuethat is TRUE when the SFC is to be reset.

    Action State - This variable is accessed by appending a .Q to the action name (e.g.ActionName.Q). It isa BOOL value that is TRUE whenever input to the action is TRUE.

    Step State - This variable is accessed by appending a .X to the step name (e.g. StepName.X). It is aBOOL value that is TRUE whenever input to the step is TRUE.

    These variables are available anywhere on the SFC network . A network consists of all the sheets in

    which the same local variables are available. For example, if the SFC is contained in a Derived FunctionBlock, the variables are available on the Derived Function Block sheet that contains the SFC as well as on

    the actions within that SFC. However, if the SFC is contained inside of a non-boolean action that residesin a Derived Function Block, the variables are available on the sheet that contains the SFC, the actions

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    10/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-10 July 2001

    within that SFC, and the function block sheet containing the non-boolean action. Note that these sheets

    make up the SFC network.

    For example an SFC, CHART22, is contained in the body of a non-boolean action, ACTION22, located

    in a function block network. Due to the placement of the SFC, the mode and reset variables are availableon the function block sheet. This accessibility is shown in Figure 15-11 and Figure 15-12. Note that the

    ChartName.M and ChartName.R variables can be assigned to other variables (MODE and RESET in the

    examples) so that the values can be displayed in 4-mation.

    TRUEACTION 22

    MANUAL

    EN

    MSG

    00001068

    Figure 1511 Accessing the Mode Variable of an SFC

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    11/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-11

    TRUE

    ENACTION 22

    FALSE

    RESET

    00001069

    Figure 1512 Accessing the Reset Variable of an SFC

    Figure 15-13 shows the body of ACTION22. Note that the mode is also displayed by the initial step ofthe SFC as well as by the ChartName.M variable.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    12/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-12 July 2001

    TRUE

    00001070

    Figure 1513 Body of ACTION22

    15.3.2 Changing Chart Mode and Chart Reset

    The mode and reset status of a SFC can be changed by either of two methods:

    The Chart Control dialog box

    The CHRTMOD (Chart Mode) function block.

    The Chart Control dialog box, shown in Figure 15-14, is used to change the mode or reset status of asingle SFC while on-line in 4-mation.

    To change a variable using the Chart Control dialog box:

    1. From the Main Menu Bar, select On-line, Display Real-Time Data. Observe as the on-line dataappears on the SFC.

    2. From the Main Menu Bar, select On-line, SFC Control. This opens the Chart Control dialog box.

    3. Place the cursor on a step within the SFC to be controlled. The full path name of the desired SFC isthen displayed in the Chart area of the dialog box.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    13/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-13

    Table 15-2 shows the command buttons available in each mode.

    00001071

    Figure 1514 Chart Control Dialog Box

    Table 152 SFC Chart Control Command Button Availability

    MODESCOMMAND

    BUTTONS

    AVAILABLEOFF AUTO HOLD MANUAL TRACE

    Set X X X X X

    Cancel X X X X X

    Reset X X

    Disable X X

    Enable X X

    Enable All X X

    Allow StepTransition Forcing

    X X

    Use the Chart Control dialog box to perform any of the following operations as needed:

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    14/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-14 July 2001

    To manually reset an SFC:

    1. Place the cursor on the SFC2. Press the Reset button

    To turn an SFC OFF:

    1. Place the cursor on the SFC2. Select the Off option button

    3. Press the Set button

    To place an SFC in AUTO:

    1. Place the cursor on the SFC2. Select the Auto option button

    3. Press the Set button

    To place an SFC in HOLD:

    1. Place the cursor on the SFC2. Select the Hold option button3. Press the Set command button

    To place an SFC in MANUAL:

    1. Place cursor on the SFC

    2. Select the Manual option button3. Press the Set button

    To allow the toggling of steps on and off (i.e. make the steps active and inactive), check the Allow

    Steps/Transition Forcing check box, shown in the lower left corner of the dialog box. As long as the box ischecked, the SFCs steps can be activated or deactivated manually. While in the Manual mode, steps can

    also be enabled and disabled individually using the Disable/Enable or Enable All buttons.

    NOTE

    The SFC Chart Control dialog box is used to change the one mode of asingle chart. To modify more than one chart, use the Chart Mode(CHRTMOD) function block as described below. Refer to Sequential

    Function Chart(document number CG39-27), for more information.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    15/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-15

    The Chart Mode (CHRTMOD) function block is used to change the mode or reset status of several SFCs

    using logic or an operator interface such as APACS ProcessSuite. The CHRTMOD block is extensible,accommodating up to 12 SFCs as inputs. As long as the blocks EN input is TRUE, the (MODE) input

    integer is written to the mode variable of each SFC that is input to the block. At the same time, if the Rinput is TRUE, each SFC is reset. The SFCs are accessed by their address. That is, the relative position ofthe SFC to the CHRTMOD function block is used in string form (enclosed in single quotes) as an input tothe block. The example shown in Figure 15-15 shows the relative address of CHART22 applied to inputCHART01 is .CHART22. Note that the leading period (.) character signifies that the addressing begins

    with the current sheet. Since CHART22 is in ACTION22, and actions are extensions to the sheet onwhich they reside. The SFC is considered to reside on the current sheet. This example shows theCHRTMOD block placed on the same effective sheet as the SFC, but, this is not mandatory. TheCHRTMOD block can be placed anywhere in the configuration. However, the relative addresses mustchange accordingly.

    For example, the second input to the CHRTMOD block in Figure 15-25 is .SFC2.CHART11. This inputis referencing CHART11 that resides on the Derived Function Block with the instance name of SFC2. It isalso known that the DFB SFC2 resides on the current sheet because the address begins with a leading

    period character.

    0

    2

    1

    FALSE

    FALSE

    ACTION 22TRUE

    EN

    EN_2

    FALSE

    FALSE

    RESET

    00001072

    Figure 1515 Using the CHRTMOD Function Block

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    16/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-16 July 2001

    15.3.3 Active Step List

    When 4-mation is in the on-line mode, it maintains a list of active steps for each SFC. The active steps arelisted in the Active Step List dialog box as shown in Figure 15-16. To view the list (when on-line) from the

    Main Menu Bar, select On-line, Active Step List to open the dialog box. The box displays the active stepsfrom a single chart, or for all charts within a network.

    00001073

    Figure 1516 Active Step List Dialog Box

    15.4 SFC ON-LINE DATA DISPLAY

    When 4-mation is on-line, the SFC mode (Off, Auto, Manual, Hold or Trace) is displayed on the initialstep.

    In the on-line mode, the active steps and actions are displayed in the configured ON color. To define theON and OFF color, see section 3.4, Screen Colors.

    The state of the step (X) is determined by the previous transition condition, while the state of the action

    block (Q) is determined by the state of the step and the action qualifier. This explains why an action maybe active, while a step is inactive, and vice versa.

    For example, the transition previous to the step changes from FALSE to TRUE and the action qualifier isP (pulse). The on-line mode shows the state of the step as ON; however, because of the pulse actionqualifier, the action block is only be in the ON state for two (minimum) control module scans. Due to the

    speed of the pulse, you may not be able to see the action turn green on the screen. The step remains in theON state until the successor transition turns TRUE, and the step is no longer active.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    17/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-17

    The ChartName.M and ChartName.R variables are not shown with their current values in the on-line

    mode. To display the on-line data value, the .M or.Rvariables must be assigned to another variable. InFigure 15-16, the on-line value of CHART22.R is not shown (no value shown) above the variable, but is

    instead shown above the global |CH22RESET| variable.

    15.5 CREATING A SEQUENTIAL FUNCTION CHART

    To begin creating an SFC, you must first be in a sheet defined to be configured in the SFC language. Any

    program block, derived function block or user-defined function block can be defined as an SFC sheet.First, the program block, DFB, or UDFB must be created and placed on a sheet (see section 5). Once thisis accomplished, the language can be selected.

    To define a sheet for SFC configuration:

    1. Open the program block, derived or user-defined function block by placing the cursor on the block and

    double-clicking the left mouse button. This opens the Sheet Type dialog box as shown in Figure 15-17.

    2. Select the Sequential Function Chart option button.

    3. Click the OK button to close the dialog box and open a new sheet that is ready for configuration in theSequential Function Chart language.

    When an SFC Sheet opens, a multi-level icon bar, for choosing SFC configuration elements, is displayed

    on the bottom of the screen as shown in Figure 15-18.

    00001049

    Figure 1517 Sheet Type Dialog Box

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    18/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-18 July 2001

    Icon Bar

    Icon Bar

    Icon Bar

    Icon Bar

    00001075

    Figure 1518 Sequential Function Chart Icon Bars

    While in an SFC, whether it is within a program block, a DFB, or a UDFB, the same method ofconfiguration applies.

    To create an SFC in the MULTIPLE selection mode:

    1. Click on the icon of the desired SFC element (step, action, transition, wire, branch, etc.) to beconfigured.

    2. Click on the cell where the element is to be placed on the sheet.3. Change the default name for the step and transition (optional).

    The following additional information is provided to make SFC creation easier.

    STEPS - The default name of a step or chart can be changed by placing the cursor on the step or initialstep (the initial step name is the chart name), typing the new name, and pressing [Enter]. For additional

    information on steps, refer to Sequential Function Chart(document number CG39-27).

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    19/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-19

    TRANSITIONS - Transitions can be simple structured text statements or additional network sheets. For

    additional information on transitions refer to Sequential Function Chart(document number CG39-27).

    The method used to create an SFC depends on the icon bar selection. Selection options include Multiple

    Selection and Single Selection (see section 3.2 for more information on these options). If in the MultipleSelection (default) mode, the selected icon remains active after each placement, then every click of the

    pointing device on a new cell places an element in that cell. To deactivate the icon, click on it again. In

    Single Select mode, the icon is deactivated after each placement so that an icon (even the same icon) mustbe selected before each cell placement.

    CHART CONNECTIONS - SFCs contain additional connection elements not available in function blockdiagrams or ladder logic diagrams. These connection elements, also called wires, are displayed byselecting the WIRE icon shown in Figure 15-18.

    Selecting WIRE provides access to the three additional icon bars, as shown in Figure 15-19. These Wireicon bars are displayed one at a time. Clicking the NEXT icon toggles the display to reveal the other barsin sequence.

    Directed wire elements are Wire symbols with arrows ([F5] and [F6] of the second icon bar). They can beused in place of [F1] (from first icon bar) to more clearly show the charts direction of flow.

    For example, Figure 15-10 shows how these direction wires are used. A series of double-line wires areutilized to represent simultaneous sequences (either divergence or convergence). These special wires are

    available from the last icon bar shown in Figure 15-18. See Figure 15-8 for an example of how thesimultaneous sequence wires are used.

    Another set of special wires is represented by [F7] and [F8] of the second icon bar. This is also shown inFigure 15-18. These wires represent stubs. Stubs can be used in the sequential function chart language to

    pass control from one cell to another without having to connect wires. This feature is helpful oncomplicated looped charts when the signal from the last transition is to be passed back to the initial step.Rather than wiring the bottom output all the way back to the top of the chart, simply pass the last

    transitions signal to a stub using the [F8] symbol, then place another [F8] stub symbol (with the samename) in the cell above the initial step.

    15.6 CHART VALIDITY

    The rules of evolution (see section 15.2) place constraints on how SFC elements can be connected.

    However, following these constraints is not sufficient to create an SFC that can be safely executed. AnSFC is considered valid if it is possible to evolve the SFC so that each step can be activated.

    When an attempt is made to place an SFC element on a sheet, some initial checking is performed to verifywhether the individual element is valid at its location. 4-mation performs the following tests whenever an

    SFC element is placed on a sheet:

    Test for convergence from dissimilar objects

    Test for divergence into dissimilar objects

    Test for one step passing control to another step

    Test for a transition passing control to another transition

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    20/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-20 July 2001

    Test for an attempt to selectively diverge or converge with multiple steps

    Test for an attempt to simultaneously diverge or converge with multiple transitions

    Test for more than one initial step in a chart

    Test for duplicate step names within a chart

    If any of the above situations occur, the element is not valid and is not placed on the sheet. When anelement is successfully placed, some validity checking of the chart takes place. A validity flag inside thechart is set based on the results. This flag is used to inform the control module whether the chart should beexecuted. Only valid charts are executed.

    To determine if a particular chart is valid in the on-line or off-line mode, place the cursor on an element inthe chart. From the Main Menu Bar, select View, Chart Validity. A dialog box opens and displays amessage indicating whether the chart is valid or invalid. If the chart is invalid, one of the following

    diagnostic messages is displayed:

    Missing Initial Step. Cause: A chart must have one, and only one, Initial Step.

    Dangling Transition Following StepName. Cause: A non-looped chart must not end in a

    transition. (Refer to example in Figure 15-19)

    Step Stepname Never Converged From A Simultaneous Divergence. Cause: A simultaneous

    divergence must be followed by a matching simultaneous convergence. (Refer to example inFigure 15-20)

    Unreachable: Transition Following Step StepName Can Never Be Reached. Cause: The

    preceding steps can never simultaneously be active. A simultaneous convergence must occur

    with a simultaneous divergence. (Refer to example in Figure 15-21)

    Unsafe: Uncontrolled Proliferation Of Control With Step StepName. Cause: A branch froma simultaneous divergence occurs. The last step in the chart can never be reached if the branch

    becomes active. This error also occurs if a portion of a simultaneous convergence line is notpresent. (Refer to example in Figure 15-22)

    Figure 1519 Dangling Transition - NOT VALID

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    21/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-21

    StepName

    00001077

    Figure 1520 Simultaneous Divergence without a Simultaneous Convergence - NOTVALID

    StepName

    00001078

    Figure 1521 Simultaneous Convergence without a Simultaneous Divergence - NOTVALID

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    22/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-22 July 2001

    Figure 1522 Unsafe Chart - NOT VALID

    15.7 SFC EXAMPLE

    A simplified batch process is used to demonstrate the configuration of Sequential Function Charts usingfunction blocks and structured text. Please note that this example is for illustrative purposes only and doesnot represent an actual process. The solutions do not include alarms, communication to an operator

    console, configuration of I/O modules, or a means for the operator to abort the batch sequence.

    The process, shown in Figure 15-23, utilizes a recipe that combines ingredients A and B in a reactor, heats

    the mixture, cools the mixture, and finally dumps the finished product.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    23/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-23

    00001080

    Operator Panel

    IngredientAStorage

    IngredientBStorage SW222

    Start Batch

    PMP201

    VLV101 VLV102PMP202

    AGIT222

    TT222

    TIC201

    TIC202

    LT222

    VLV200

    Drain

    PRODUCT

    VLV222

    PMP222

    VLV202

    VLV201

    HeatingWater

    Cooling

    Water

    Figure 1523 Example Batch Process

    This example process requires the following operations:

    1. Initialize reactor if the batch has been started by the operator (if SW222 is high). Initialization

    involves pre-setting the state of all of the pumps and valves before any ingredients are added to thereactor. Close the reactors drain valves VLV200 and VLV222, ensure the ingredient valves and

    pumps are closed/off (VLV101, VLV102, PMP201, PMP202), close the heating and cooling water

    valves (VLV201, VLV202), stop the agitator (AGIT222) and circulation pump (PMP222). Althougheach step in the batch sequence changes the state of pumps and valves as required, initialization of

    each variable is still being performed here.

    2. Simultaneously charge the reactor with ingredients A and B if the initialization step has beencompleted. Charging involves opening solenoid valves VLV101 and VLV102 for ingredients A and

    B, turning on pumps PMP201 and PMP202 after a delay of 1 second. Allow the ingredients to chargefor 50.0 seconds, close both valves and turn both pumps off.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    24/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-24 July 2001

    3. After both ingredients have been charged, start the agitator (AGIT222). Remain agitating until the

    temperature input reaches 90C. PID logic in another portion of the PROGRAM handles actual PIDcontrol to heat

    4. After heating is finished, the cooling step begins. Keep agitating until the temperature input reaches

    20C. PID logic in another portion of the PROGRAM handles actual PID control to cool.

    5. Dump the contents after the ingredients have been cooled. This step involves opening the valve

    VLV222 on the reactor to drain the product, opening the valve VLV200 to drain the water out of thereactors jacket, stopping the agitator AGIT222, closing both heating and cooling water valvesVLV201 and VLV202, and stopping the circulation pump PMP222.

    The batch must be prohibited from restarting until the reactor has been drained to below 2.0 inches. Usethe level transmitter LT222.

    Typically, an emergency stop type function would be used to place the chart in the OFF mode. Thatwould allow an operator to fix the problem and restart the chart from the last state. The emergency stopfunction could be placed within another chart in the same SFC sheet. This chart would contain an initial

    step, a transition to handle the emergency stop signal, a step and action block to place the chart in the OFFmode, and finally a transition that is always true and that loops back to the initial step.

    There is more than one correct way to create a Sequential Function Chart for the process described above.Solution A, illustrated in Figures 15-24 to 15-29, show the most organized way to create a medium to largesized chart. In Solution A, each step in the chart represents a key operation in the process (initialize,charge, heat, cool, and, dump). Since the heating operation in this example is too complex to be performed

    by a boolean action alone, an action body is defined. The language of the action body is that which is most

    appropriate for the process.

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    25/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-25

    Solution:

    Variable

    Standard Function Block

    Passed Variable

    as a reference

    Local Variable

    as a reference Coil

    00001055

    Derived Function BlocShuntContact

    Figure 1524 Example Batch Process Sequential Function Chart

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    26/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-26 July 2001

    Solution: (continued)

    STOP N CHART4_OFF

    EMERG_CHT4

    : = TRUE

    : = EMERGSTOP_CH4

    00001082

    Figure 1525 Emergency Shutdown for CHART004

    VAR

    DO_CHRG_A, DO_CHRG_B : BOOL;

    END_VAR

    %VLV222 := FALSE;

    %VLV101 := FALSE;%VLV102 := FALSE;

    %VLV201 := 0.0;

    %VLV202 := 0.0;

    %PMP201 := FALSE;

    %PMP202 := FALSE;

    %AGIT222 := FALSE;

    %PMP222 := FALSE;

    DO_CHRG_A := TRUE;

    DO_CHRG_B := TRUE;

    INIT_DONE := TRUE;

    00001083

    Figure 1526 Body of INITIALIZE Action

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    27/28

    CG39-20 USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

    July 2001 15-27

    Solution: (continued)

    00001084

    STEP1L

    A

    : = A_DONE

    : = DO_CHRG_A

    : = -%VLV101

    T#0d0h0m50s0ms%VLV101

    T#0d0h0m1s0ms%PMP201

    D

    STEP2 N A_DONE

    DO_CHRG_AR

    Figure 1527 Body of CHRG_A Action

  • 7/30/2019 Anexo 09 Grafcet Using Sequential Funtion Chart Language

    28/28

    USING THE SEQUENTIAL FUNCTION CHART LANGUAGE CG39-20

    15-28 July 2001

    Solution: (continued)

    00001085

    STEP1L

    B

    : = B_DONE

    : = DO_CHRG_B

    : = -%VLV102

    T#0d0h0m50s0ms%VLV102

    T#0d0h0m1s0ms%PMP202

    D

    STEP2 N B_DONE

    DO_CHRG_BR

    Figure 1528 Body of CHRG_B Action

    00001086

    %VLV202 := 0.0; (*CLOSE COOLING VALVE*)

    %PMP222 := FALSE; (*STOP CIRCULATING PUMP*)

    %VLV222 := TRUE; (*DRAIN REACTOR PRODUCT*)

    %VLV200 := TRUE; (*DRAIN COOLING WATER*)

    Figure 1529 Body of DUMP Action