Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

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 network sheet. 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. The elements 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).
Initial Step Step Non-boolean Action Boolean Action

Branch

Transistion

Structured Text Statement


00001058

Figure 151 Example Sequential Function Chart

July 2001

15-1

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 if the associated transition condition is TRUE. When a TRUE transition is encountered, all steps that flow into 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 section 15.2.2), any remaining untested transitions, also within that Divergence of Sequence Selection, are removed 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 SFC executes STEP1 again if the first transition condition is TRUE. The loop can be created by wiring 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 that pulses 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 from outside of the chart.

15-2

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CHART01

: = COND1 & COND2

STEP1

ACTION1

: = TRANS2

STEP2

ACTION2

: = - (COND1 & COND2)

00001059

Figure 152 Looped Chart

CHART02

: = COND1 & COND2

STEP1

ACTION1

: = TRANS2

STEP2

ACTION2

00001060

Figure 153 Terminated Chart

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

July 2001

15-3

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

15.2.1 Single Sequence

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

STEP2

. .

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, and transition D is TRUE. Note that a divergence is represented by transitions under the horizontal line. The transitions are evaluated from left to right.
. .

STEP2

C STEP3 STEP4

. .

. .
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 to STEP5 occurs only if STEP4 is active and transition F is TRUE. A convergence is represented by transitions above the horizontal line.

15-4

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

. .

. .

STEP3 E

STEP4 F

STEP5

. .

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 STEP6 and STEP7 occurs only if STEP5 is active and the transition condition G is TRUE. After the simultaneous 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 horizontal line. To emphasize the special nature of such transitions, the divergence of a simultaneous sequence is indicated by a double horizontal line.
. .

STEP5 G

STEP6

STEP7

. .

. .
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.

July 2001

15-5

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

15.2.5 Simultaneous Convergence of Sequence

In a Simultaneous Convergence of Sequence, as shown in Figure 15-8, an evolution from STEP6 or STEP7 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 double horizontal line. To emphasize the special nature of such transitions, the convergence of a simultaneous sequence is indicated by a double horizontal line.
. . . .

STEP6

STEP7

H STEP8 . .
00001065

Figure 158 Simultaneous Convergence of a Sequence in an SFC

An SFC using a Simultaneous Convergence of Sequence must also contain a preceding Simultaneous Divergence 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 one or more of the branches contain zero steps

15-6

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

. .

STEP30

A STEP31 B STEP32 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 if transition 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 D transition 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 the branches 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 any valid 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 step does not have a successor transition.)

July 2001

15-7

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

. .

STEP30 A

STEP31 B STEP32

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 SFC in this mode. Transition conditions are not evaluated. Auto - This mode permits the chart to run normally through its programmed sequence in full automatic operation. 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 transitions occur 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 are not 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 the CHRTMOD (Chart Mode) function block. Trace mode is helpful when debugging an SFC. If the structure of the SFC is modified, such as adding steps, the SFC is reset to the initial step. To test one or more new steps, the SFC can be manually stepped in Trace mode to the new step(s).
15-8 July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

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


Table 151 SFC Mode Evolution

MODE

ARE ACTION ASSOCIATIONS EVALUATED ?

ARE ENABLED WILL A TRANSITIONS TRANSITION EVALUATED ? BE CLEARED IF POSSIBLE ?

WILL THE TIME VALUE OF STEPS BE INCREMENTED ?

Off Auto Manual Hold Trace

No Yes Yes Yes No

No Yes No No No

No Yes Yes No Yes

No Yes Yes 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 = Off 1 = Automatic mode 2 = Manual mode 3 = Hold mode 4 = Trace mode
Reset - This variable is accessed by appending a .R to the SFC (e.g. ChartName.R). It is a BOOL value that 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 is a 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 a BOOL 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 Function Block, 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 resides in a Derived Function Block, the variables are available on the sheet that contains the SFC, the actions
July 2001 15-9

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 available on 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.

TRUE
EN

ACTION 22

MANUAL MSG

00001068

Figure 1511 Accessing the Mode Variable of an SFC

15-10

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

TRUE EN

ACTION 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 of the SFC as well as by the ChartName.M variable.

July 2001

15-11

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 a single 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 data appears 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 is then displayed in the Chart area of the dialog box.

15-12

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

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

COMMAND BUTTONS AVAILABLE OFF

MODES

AUTO HOLD MANUAL

TRACE

Set Cancel Reset Disable Enable Enable All Allow Step Transition Forcing

X X X

X X

X X

X X

X X X

X X X X

X X X X

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

July 2001

15-13

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

To manually reset an SFC:

1. Place the cursor on the SFC 2. Press the Reset button


To turn an SFC OFF:

1. Place the cursor on the SFC 2. Select the Off option button 3. Press the Set button

To place an SFC in AUTO:

1. Place the cursor on the SFC 2. Select the Auto option button 3. Press the Set button
To place an SFC in HOLD:

1. Place the cursor on the SFC 2. Select the Hold option button 3. Press the Set command button
To place an SFC in MANUAL:

1. Place cursor on the SFC 2. Select the Manual option button 3. 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 is checked, 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 a single 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.

15-14

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

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 R input is TRUE, each SFC is reset. The SFCs are accessed by their address. That is, the relative position of the SFC to the CHRTMOD function block is used in string form (enclosed in single quotes) as an input to the block. The example shown in Figure 15-15 shows the relative address of CHART22 applied to input CHART01 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 on which they reside. The SFC is considered to reside on the current sheet. This example shows the CHRTMOD block placed on the same effective sheet as the SFC, but, this is not mandatory. The CHRTMOD block can be placed anywhere in the configuration. However, the relative addresses must change accordingly. For example, the second input to the CHRTMOD block in Figure 15-25 is .SFC2.CHART11. This input is referencing CHART11 that resides on the Derived Function Block with the instance name of SFC2. It is also known that the DFB SFC2 resides on the current sheet because the address begins with a leading period character.

TRUE EN

ACTION 22

FALSE EN_2 FALSE RESET

FALSE FALSE 0 2 1

00001072

Figure 1515 Using the CHRTMOD Function Block

July 2001

15-15

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 are listed 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 steps from 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 initial step. In the on-line mode, the active steps and actions are displayed in the configured ON color. To define the ON 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 may be 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 is P (pulse). The on-line mode shows the state of the step as ON; however, because of the pulse action qualifier, 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 the ON state until the successor transition turns TRUE, and the step is no longer active.

15-16

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

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 .R variables must be assigned to another variable. In Figure 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 this is 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 the Sequential 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

July 2001

15-17

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 of configuration 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 be configured. 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 initial step (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).

15-18

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

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 Multiple Selection (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) must be selected before each cell placement.
CHART CONNECTIONS - SFCs contain additional connection elements not available in function block diagrams or ladder logic diagrams. These connection elements, also called wires, are displayed by selecting 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 Wire icon bars are displayed one at a time. Clicking the NEXT icon toggles the display to reveal the other bars in sequence. Directed wire elements are Wire symbols with arrows ([F5] and [F6] of the second icon bar). They can be used 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 are utilized 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 the simultaneous sequence wires are used. Another set of special wires is represented by [F7] and [F8] of the second icon bar. This is also shown in Figure 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 on complicated 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 same name) 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. An SFC 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 verify whether 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
15-19

July 2001

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 an element is successfully placed, some validity checking of the chart takes place. A validity flag inside the chart is set based on the results. This flag is used to inform the control module whether the chart should be executed. 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 in the chart. From the Main Menu Bar, select View, Chart Validity. A dialog box opens and displays a message 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 in Figure 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 from a 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 not present. (Refer to example in Figure 15-22)

Figure 1519 Dangling Transition - NOT VALID

15-20

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

StepName

00001077

Figure 1520 Simultaneous Divergence without a Simultaneous Convergence - NOT VALID

StepName

00001078

Figure 1521 Simultaneous Convergence without a Simultaneous Divergence - NOT VALID

July 2001

15-21

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

Figure 1522 Unsafe Chart - NOT VALID 15.7 SFC EXAMPLE

A simplified batch process is used to demonstrate the configuration of Sequential Function Charts using function blocks and structured text. Please note that this example is for illustrative purposes only and does not 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.

15-22

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

Operator Panel Ingredient A Storage Ingredient B Storage SW222 Start Batch

VLV101

VLV102

PMP202

AGIT222

PMP201

TIC 201

TT 222

TIC 202 Heating Water VLV201 LT 222 PMP222

Cooling Water VLV202 VLV222

VLV200 Drain PRODUCT


00001080

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 the reactor. 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). Although each 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 been completed. 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 charge for 50.0 seconds, close both valves and turn both pumps off.
July 2001 15-23

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

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 PID control 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 the reactors jacket, stopping the agitator AGIT222, closing both heating and cooling water valves VLV201 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. Use the level transmitter LT222. Typically, an emergency stop type function would be used to place the chart in the OFF mode. That would allow an operator to fix the problem and restart the chart from the last state. The emergency stop function 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 OFF mode, 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 large sized 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.

15-24

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

Solution:

Local V ariable Standard FunctionB lock Passed Variable as a reference V ariable as a reference

C oil

C ontact

S hunt

D erivedFunctionB lock
00001055

Figure 1524 Example Batch Process Sequential Function Chart

July 2001

15-25

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

Solution: (continued)

EMERG_CHT4

: = EMERGSTOP_CH4

STOP

CHART4_OFF

: = TRUE

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

15-26

July 2001

CG39-20

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

Solution: (continued)

: = DO_CHRG_A L T#0d0h0m50s0ms D T#0d0h0m1s0ms : = -%VLV101 %PMP201

STEP1

%VLV101

STEP2

A_DONE

DO_CHRG_A

: = A_DONE

00001084

Figure 1527 Body of CHRG_A Action

July 2001

15-27

USING THE SEQUENTIAL FUNCTION CHART LANGUAGE

CG39-20

Solution: (continued)

: = DO_CHRG_B L T#0d0h0m50s0ms D T#0d0h0m1s0ms : = -%VLV102 %PMP202

STEP1

%VLV102

STEP2

B_DONE

DO_CHRG_B

: = B_DONE

00001085

Figure 1528 Body of CHRG_B Action


%VLV202 := 0.0; (*CLOSE COOLING VALVE*) %PMP222 := FALSE; (*STOP CIRCULATING PUMP*) %VLV222 := TRUE; (*DRAIN REACTOR PRODUCT*) %VLV200 := TRUE; (*DRAIN COOLING WATER*)
00001086

Figure 1529 Body of DUMP Action

15-28

July 2001

You might also like