Вы находитесь на странице: 1из 44

CG39-27 CONTENTS

TABLE OF CONTENTS

SECTION AND TITLE PAGE

1.0 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1


1.1 DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2 RELATED LITERATURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1

2.0 SEQUENTIAL FUNCTION CHART ELEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1

3.0 STEPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1


3.1 INITIAL STEPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1

4.0 TRANSITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1


4.1 STRUCTURED TEXT TRANSITION CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2 TRANSITION NAME TRANSITION CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

5.0 ACTION ELEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1


5.1 BOOLEAN ACTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.2 NON-BOOLEAN ACTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
5.3 ACTION QUALIFIERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
5.3.1 N (Non-Stored) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5.3.2 S (Set-Stored) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.3.3 R (Overriding-Reset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
5.3.4 P (Pulse) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
5.3.5 L (Time Limited) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
5.3.6 SL (Stored & Time Limited) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
5.3.7 D (Time Delayed) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
5.3.8 SD (Stored & Time Delayed) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
5.3.9 DS (Delayed & Stored) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
5.4 ACTIONS ON A FUNCTION BLOCK DIAGRAM NETWORK . . . . . . . . . . . . . . . . . . . . . . 5-15
5.5 ACTIONS ON A SEQUENTIAL FUNCTION CHART NETWORK . . . . . . . . . . . . . . . . . . . 5-17
5.6 ACTION CONCATENATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
5.7 ACTION EXECUTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
5.8 ON-LINE DATA DISPLAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22
5.9 ACTION EXAMPLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23

January 1997 i
CONTENTS CG39-27

LIST OF FIGURES

FIGURE TITLE PAGE

2-1 Example Sequential Function Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1

3-1 Step Flag and Step Time Variables Used Within a Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
4-1 Transition Using Structured Text Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4-2 Transition Using Transition Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4-3 Algorithm List Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4-4 Variable Declaration Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4

5-1 Boolean Action Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2


5-2 Non-Boolean Action Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
5-3 Action Block Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5-4 Examples of Action Blocks in SFC and FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5-5 Non-Stored Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5-6 Set-Stored Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5-7 Overriding-Reset Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
5-8 Pulse Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
5-9 Time Limited Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
5-10 Stored and Time Limited Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11
5-11 Time Delayed Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
5-12 Stored and Time Delayed Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
5-13 Delayed and Stored Action Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14
5-14 Function Block Diagram Icon Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
5-15 Action Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17
5-16 Sequential Function Chart Language Icon Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17
5-17 Action Block Icon Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
5-18 Step Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20
5-19 Example of One Action Affecting Another . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20
5-20 Solution A: Function Block Language Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23
5-21 Body of EMERG_SHUTDWN Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
5-22 Solution B, Function Block Language Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
5-23 Body of EMERG_DWN User Defined Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25

LIST OF TABLES

TABLE TITLE PAGE

5-1 Action Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5

ii January 1997
CG39-27 CONTENTS

Moore Products Co. assumes no liability for errors or omissions in this document or for the application and use of information
included in this document. The information herein is subject to change without notice.

The Moore logo, APACS, the APACS logo, QUADLOG, and 4-mation are trademarks of Moore Products Co.
All other trademarks are the property of the respective owners.

January 1997 iii


CONTENTS CG39-27

1997 Moore Products Co. All rights reserved.

iv January 1997
CG39-27 INTRODUCTION

1.0 INTRODUCTION

This Guide provides reference information for the Sequential Function Chart (SFC) language of the 4-mation
configuration software. It is intended to be used in conjunction with the configuration procedures located in
Using the 4-mation Configuration Software (document number CG39-20).

This Guide is arranged into the following sections:

C Section 1, Introduction

C Section 2, Sequential Function Chart Elements

C Section 3, Steps

C Section 4, Transitions

C Section 5, Action Elements

1.1 DESCRIPTION

The Sequential Function Chart (SFC) language is one of the four configuration languages of 4-mation.

Sequential Function Charts (SFCs) are recommended for batch applications since they provide the ability to
configure a sequential process using a graphical top-down design. SFC elements are also used to partition
and, therefore, organize DFBs and UDFBs into a set of steps and transitions.

1.2 RELATED LITERATURE

Document categories can be identified by the prefix (e.g. CGxx-xx) of the document number as listed here:

CG = Configuration Guide SG = Software Guide


SD = Service Data UM = User's Manual

The following 4-mation and other APACS literature is available from Moore Products Co. Generally, all
needed documentation is supplied with your system. Refer to it as needed or as directed in text.

UM39-6 4-mation Installation and Operation


This is a binder which contains the following documents:

SG39-12 Getting Started with 4-mation


CG39-20 Using the 4-mation Configuration Software
CG39-21 4-mation Software Messages and Diagnostic Codes

January 1997 1-1


INTRODUCTION CG39-27

UM39-7 4-mation Function Block Language


This is a binder which contains the following documents:

CG39-22 APACS Standard Function Blocks


CGQL-3 QUADLOG Standard Function Blocks
CG39EVENT-1 Sequence of Event Function Blocks
CG39FDI-2 Modbus Master Function Blocks for the APACS ACM
CG39FDI-3 Modbus Slave Function Blocks for the APACS ACM

UM39-8 4-mation Ladder Logic, SFC & ST Languages


This is a binder which contains the following documents:

CG39-26 Ladder Logic


CG39-27 Sequential Function Chart (this document)
CG39-28 Structured Text

UM39-9 4-mation, Configuring APACS Hardware


This is a binder which contains the following documents:

CG39-24 APACS I/O Module Configuration


CGQL-4 QUADLOG I/O Module Configuration
CG39-25 LIM Configuration

UM39-10 4-mation Application Libraries


This is a binder which contains the following document:

CG39-23 APACS Basic Application Library

1-2 January 1997


CG39-27 SEQUENTIAL FUNCTION CHART ELEMENTS

2.0 SEQUENTIAL FUNCTION CHART ELEMENTS


The Sequential Function Chart (SFC) language is configured on a 128 x 128 cell grid called a 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 is shown in Figure 2-1. The elements permitted
in an SFC include:

C Initial Steps
C Steps
C Transitions
C Simple Structured Text Statements (considered part of the transition)
C Actions
C Branches
C Comments

Initial Step
Step Non-boolean Action Boolean Action

Branch Transistion Structured Text


Statement
00001058

FIGURE 2-1 Example Sequential Function Chart

January 1997 2-1


SEQUENTIAL FUNCTION CHART ELEMENTS CG39-27

The elements shown in Figure 2-1 form a representative SFC which can be used for reference purposes.
Individual SFC elements are detailed in the subsections to follow.

2-2 January 1997


CG39-27 STEPS

3.0 STEPS

A step is an SFC element that is used to associate a set of action blocks with a set of transitions. The set of
action blocks are connected to the right of the step element. This set may be empty when no action blocks are
shown attached to the step. The set of transitions are connected to the bottom of the step element. This set
may be empty if this is the last step of a non-loop chart.

*** where *** = Step Name

Each step has a name which is displayed in the center of the step block. The step name is a 16 (maximum)
character identifier that must be unique for all connected steps. When a step is created the 4-mation software
will automatically generate a step number of the form:

S***

where:
*** is a three digit number that starts at 000 and is incremented
for every step placed within a sheet.

A step name may be edited by selecting the cell containing the step, then modifying the name in the edit line
at the top right hand side of the window.

Each step has a step flag represented by a boolean logic value that denotes the state of the step. This boolean
variable has a TRUE state when the corresponding step is active, and a FALSE state when it is inactive. The
name of the step flag variable is:

ChartName.StepName.X;

where:
ChartName is the name of the SFC that contains the step
StepName is the name of the step.

Similarly, each step has a step time represented by an associated time variable, StepName.T. This time
variable is of data type TIME and will contain the time elapsed since the step was made active. When a step
is deactivated, the value of the elapsed time will remain at the value it had when the step was deactivated.
The name of the step time variable is:

ChartName.StepName.T;

where:
ChartName is the name of the SFC that contains the step
StepName is the name of the step.

January 1997 3-1


STEPS CG39-27

The step flag and step time are local variables in the DFB, UDFB or Program in which the step appears. A
step flag, or step time variable can be used directly anywhere within the SFC sheet, as shown in Figure 3-1, or
anywhere within the parent DFB or UDFB.

In CHART_1, the transition from STEP1 to STEP2 is based on the Step Time of STEP1 in CHART_1. In
CHART_2, the transition from STEP1 to STEP2 is based on the Step Flag of STEP1 in CHART_1.

CHART_1 CHART_2

:= TRANSIT1 := TRANSIT2

STEP1 STEP1

:= CHART_1.STEP1.T >= T#0d0h0m50s0ms := CHART_1.STEP1.X

STEP2 STEP2

FIGURE 3-1 Step Flag and Step Time Variables Used Within a Chart

3.1 INITIAL STEPS

Each SFC will have exactly one initial step. In addition to all of the properties of other steps, the initial step
for an SFC is the step that will become active when the SFC is reset.

*** where *** = Initial Step Name

The name of an SFC is the name of its initial step. In order to highlight this difference between initial steps
and other steps, the default name for initial steps are generated of the form:

CHART***

where:
*** is a three digit number that is incremented for each chart in the same DFB,
UDFB, or program.

3-2 January 1997


CG39-27 STEPS

NOTE

The number of SFCs is limited to 999.

Initial steps include all the properties of generic steps so they can have actions blocks associated with them.
These actions become active as soon as the chart is both active and in one of the modes that allows actions to
execute.

January 1997 3-3


STEPS CG39-27

3-4 January 1997


CG39-27 TRANSITIONS

4.0 TRANSITIONS

A transition, as shown here, establishes the condition that needs to be satisfied before an SFC will evolve
from one step to another. Transitions require two cells. The first contains the graphic element, the second
contains the transition condition. The transition condition may be edited by clicking on either cell of the
transition, then editing using the edit line at the top right side of the screen.

:= TRUE

If the transition condition cannot be displayed in a single cell, it will display out to the right. If another
element is encountered before all of the transition condition can be displayed, the ending of the transition
condition is displayed preceded with ...

When a transition is created, 4-mation automatically defaults the transition condition to := TRUE.

Transition conditions are only evaluated if all of the steps that precede the transition are active.

4.1 STRUCTURED TEXT TRANSITION CONDITIONS

A transition condition can be expressed using a boolean expression written in Structured Text (ST) language.
This expression must always start with the assignment operator :=.

If control was to be passed from one step to another only when variables A and B were both TRUE, for
example, the ST expression would be as shown in Figure 4-1.

:= A & B

FIGURE 4-1 Transition Using Structured Text Expression

January 1997 4-1


TRANSITIONS CG39-27

A transition which is always true is represented by the ST expression :=TRUE.

The variables used in the ST expressions can also include the step flag, the step time, the action flag,
or the action time.

Examples:
:= CHART_NAME.STEP_NAME.X
:= CHART_NAME.STEP_NAME.T >= T#0d0h1m0s0ms
:= ACTION_NAME.Q
:= ACTION_NAME.T > T#0d0h0m30s0ms

Inversion of the transition expression is performed using NOT or a - sign. For example, to only
proceed to the next step if the Boolean variable PMP200 is FALSE, use := NOT PMP200" or := -
PMP200".

After a ST transition condition has been edited it will be validated. If the transition condition is a
valid ST Boolean assignment statement, it will be written to the Sheet. However, when the ST
transition is written it may be reformatted. The reformatting attempts to show the assignment
statement with the fewest number of characters. Included in this reformation is the replacement of
the NOT operator with the - operator. The & operator replaces the AND operator. Extra spaces are
removed as well as parenthesis where they are not strictly required to establish precedence (see Table
6-1 for precedence ordering).

4.2 TRANSITION NAME TRANSITION CONDITIONS

A transition condition can be represented by a separate Sheet. In this case the transition condition is
a transition name (maximum 16 characters). The transition name refers to a separate Sheet whose
evaluation results in the assignment of a Boolean value to the transition name. That is, the separate
Sheet must write a Boolean value to a Boolean variable with the same name as the transition name.
The separate Sheet may be defined using Ladder Logic Diagrams, Function Block Diagrams
(Standard Function Blocks only), or Structured Text. This Sheet, however, may not contain other
SFCs, Actions, User Defined Function Blocks, or Derived Function Blocks. Figure 4-2 illustrates
the use of transition names.

Chart Separate Ladder Logic Sheet Representing


TRANS78

TRANS78
( )
TRANS78

FIGURE 4-2 Transition Using Transition Name

4-2 January 1997


CG39-27 TRANSITIONS

IMPORTANT

Be careful when placing any control logic, in any language, inside a


transition name. The transitions sheet will only be executed when and if
the chart evolves to the point where the value of the transition is required.
Also, certain chart modes will stop the evaluation of transitions completely.

If the transition name does not exist, an Algorithm List dialog box will open as shown in Figure 4-3.
The transition name entered on the sheet will already be displayed in the Name edit box, however, the
Create option button must be selected to actually create the transition. A Variable Declaration dialog
box opens so the variable can be ADDed to the list. This variable is the Boolean variable that the
additional sheet must result in to assign the transition a value. The transition name may be up to 16
characters and may be upper or lower case. Note that 4-mation is case sensitive. The Variable
Declaration dialog box is shown in Figure 4-4.

00001097

FIGURE 4-3 Algorithm List Dialog Box

January 1997 4-3


TRANSITIONS CG39-27

SG13021.DS4
FIGURE 4-4 Variable Declaration Dialog Box

The Delete option button will eliminate the currently selected transition within the Algorithm List
dialog box only if the selected transition is not currently being used on a sheet.

The Rename option button will change the name of the currently selected transition within the
Algorithm List Box to the name entered in the Name Edit Box only if the selected transition is not
currently being used on a sheet.

All of the transition names (not Structured Text expressions) in the current DFB or UDFB will be
displayed in the Algorithm List box when the Transition option button is selected.

Once the transition name is defined and the sheet is downloaded, the contents of the transition can be
specified by double-clicking on the transition name with a mouse, or using the View, Body menu
item. The desired transition language type (Function Block Diagram, Ladder Logic Diagram or
Structured Text) is then selected.

4-4 January 1997


CG39-27 ACTION ELEMENTS

5.0 ACTION ELEMENTS


An Action is a configuration element that provides an additional configuration sheet that is considered an
extention to the sheet on which it it placed. It is often used as a means of partitioning logic. An Action,
however, has local scope. It is possible to have two Actions in two different Derived Function Blocks (DFBs)
with the same name. The bodies of the Actions will be unique, and editing one will have no effect on the
other.

The local scope of an Action is carried over to the variables. An Action shares the local variable list of the
Program Organization Unit (POUs include DFBs, UDFBs and programs) in which the Action is defined.
That is, all variables defined in an Action are in the local variable list of the POU, and any variable defined in
the POU may be used in the Action. Input and outputs of the POU are also available to the Action.

Each Action has an action flag represented by a Boolean variable, that denotes the activity of the Action.
This Boolean variable has a TRUE state when the corresponding Action is active, and a FALSE state when it
is inactive. This variable can be placed on a function block sheet or a ladder logic sheet for display or use,
however, the sheet must be local (or on the same hierarchical level) as the SFC. For example, the action flag
can be displayed or used inside another Action being configured as function block or ladder logic. The name
of the action flag for a specific Action is:

ActionName.Q

where:
ActionName is the name of the Action.

Similarly, each Action has an action time represented by a time variable. This time variable is of data type
TIME and will contain the time elapsed since the Action was made active. When an Action is deactivated,
the value of the elapsed time will remain at the value it had when the Action was deactivated. Action time
will be zero if the Action has never been active and for the first scan that an Action is enabled. Certain action
qualifiers (see Section 5.3) also have zero action time. The action time can be used in the same manner as the
action flag. The name of the action time variable for a specific action is:

ActionName.T

where:
ActionName is the name of the Action.

In order to utilize an Action, an action block must be placed on the sheet. An action block associates the
Action with an action qualifier and an enabling condition. An Action may be associated with many different
action blocks within a single POU. Before any Action can be executed, the status of all of the action blocks
on a Sheet must be determined. This means that the execution of an Action cannot be determined by where
an action block is placed. It must be assumed that any variables changed within the Action are not available
until the next scan of the sheet.

Action blocks may have either no input nubs, or a single input nub. The input nub is used to connect a
boolean expression or variable to be the enabling condition for the action block. In the SFC language, this

January 1997 5-1


ACTION ELEMENTS CG39-27

nub will be connected to a step. This means that the step flag is used as the enabling condition. In the
function block language, this nub may be connected to a boolean output of any function block, a boolean
variable, a boolean constant (TRUE or FALSE), or even a structured Test (ST) expression that evaluates to a
boolean. Also, in the function block language, the value of this input nub is passed through to an output nub.

An action block with no input nub must be placed underneath an action block with an input nub. An action
block with more than one input must be placed underneath so they form an unbroken stack of action blocks.
All action blocks placed in this manner will share a common enabling condition. No input action blocks
placed above such a stack are not considered part of the stack. If an action block with an input nub is placed
in such a stack, the stack is considered split at the point this action block is placed. All of the Actions above
this Action are in one stack and all of the Actions after this block, and including this block, are in a different
stack.

There are two types of Actions: Boolean actions and non-Boolean actions as described in the following
subsections..

5.1 BOOLEAN ACTIONS

Boolean Actions perform a setting or resetting operation on the Boolean variable created by the Action. All
information required is visible in the Boolean action block as shown in Figure 5-1 (i.e. no additional sheet, or
a body, is required).

a b

FIGURE 5-1 Boolean Action Block

The a field holds the action qualifier and the b field holds the name of the boolean variable. For
example: If the purpose of this Action is to turn a pump on, the action qualifier would be N and the boolean
variable may be PMP101. This Action will set the variable to TRUE while the input to the action block is
TRUE.

5.2 NON-BOOLEAN ACTIONS

Non-Boolean Actions allow very detailed portions of a configuration to be specified on a separate sheet in
any of the four configuration languages. Complex batch processes, for example, may not be able to fit every
detail of the sequence on one Sheet. To organize the sequence, the batch can be broken down into several key
steps. These steps in turn will activate Actions, and these Actions can, themselves, contain sequential
function charts, structured text, ladder logic diagrams or function block diagrams.

A non-Boolean Action, as shown in Figure 5-2, is similar to a DFB or UDFB, in that it is configurable in any
language. The key difference between them is that Actions are only executed when the Action is active.

5-2 January 1997


CG39-27 ACTION ELEMENTS

DFBs or UDFBs are executed every controller scan. The fact that the action body is not always being
executed is important from both a control and computing capacity point of view. Control strategies that are
to be executed only under certain circumstances can be placed in an action body. Emergency shutdowns, for
example, should only be performed under certain conditions, such as alarms or failures. The conditions, as
well as the body of the non-Boolean Action are completely configurable.

a b c

FIGURE 5-2 Non-Boolean Action Block

The a field holds the action qualifier and the b field holds the name of the action body. Lastly, the c
field holds the name of a Boolean feedback variable. The Boolean feedback variable is optional since it is
used only for documentation purposes. The feedback variable is typically, but not necessarily, one of the
variables within the action body. Although this field is optional, the on-screen graphical symbol will always
include the c field. Creation of an action body is described in Using the 4-mation Configuration
Software (document number CG39-20).

CAUTION

Do not use Dynamic function blocks (e.g. PID block) in


Actions. The non-continuous nature of Actions may cause
unexpected results.

Several examples of action blocks are presented in Figure 5-3. An action block can also be used as a
graphical element in either the sequential function chart, or function block language. Examples are shown in
Figure 5-4.

In the example shown in Figure 5-4, the value of PMP100 AND PMP200" is passed directly to the variable
OK1.

January 1997 5-3


ACTION ELEMENTS CG39-27

N COLD_WATER_VLV

Boolean Action Block

S FILL_TANK_ACT

A Non-Boolean Action Block without a Feedback Variable

R FILL_TANK_ACT DONE

A Non-boolean Action Block with a Feedback Variable

FIGURE 5-3 Action Block Examples

STEP N ACTION1 DONE

Action Block in a Sequential Function Chart

AND

PMP100 IN01 OUT N ACTION1 DONE OK1

PMP200 IN02

Action Block in Function Block Diagram

FIGURE 5-4 Examples of Action Blocks in SFC and FBD

5-4 January 1997


CG39-27 ACTION ELEMENTS

5.3 ACTION QUALIFIERS

Associated with each action block is an action qualifier. The combination of an action qualifiers and enabling
conditions for all action blocks determine if an Action is to be executed. There are nine action qualifiers, as
shown in Table 5-1.

TABLE 5-1 Action Qualifiers

QUALIFIER EXPLANATION

N Non stored

S Set (stored)

R Overriding reset

P Pulse

L Time limited

SL Stored and time limited

D Time delayed

SD Stored and time delayed

DS Delayed and stored

Five qualifiers require a time value to be evaluated. This time value is considered part of the qualifier.
Descriptions of how action qualifiers combine with enabling conditions for enabling Actions is presented in
the following subsections. In these descriptions:

X - Represents the qualifier being illustrated

Q - Represents the active state of the Action

T - Represents the length of time specified by the time value. This time value can be either an constant
or a time variable. If it is a time variable, the value is read and stored when the action block input
becomes TRUE.

When using the S, SL, SD, and DS action qualifiers, the qualifier must be used before the Action can be
enabled again. Note the qualified action block references the same action body as the S, SL, SD or DS action
block. Diving into (Double-clicking or using View, Body) the action body from either action block will show
the same Sheet. Editing the action body from either action block will have exactly the same effect.

January 1997 5-5


ACTION ELEMENTS CG39-27

5.3.1 N (Non-Stored)

The N (Non-Stored) qualifier determines that the Action is active only when the block input is TRUE as
shown in Figure 5-5.

FIGURE 5-5 Non-Stored Action Qualifier

Example:
It is desirable to perform ACTION_1 only when ALM1, ALM2, and ALM3 are all high. As soon as one of
the alarms clears, stop executing ACTION_1.

ALM1 AND ALM2 AND ALM3 N ACTION_1 DONE

5-6 January 1997


CG39-27 ACTION ELEMENTS

5.3.2 S (Set-Stored)

The S (Set-Stored) qualifier determines that the Action becomes active when the action block input becomes
TRUE as shown in Figure 5-6. The Action will continue being executed even after X has become FALSE. In
order to stop the execution of the Action, the input to an R qualified action block that references the same
Action (R) must become TRUE. If R never becomes TRUE, the Action continues to execute indefinitely.

FIGURE 5-6 Set-Stored Action Qualifier

Example:
Open water valve (WATER_VLV) for 5 seconds, THEN start MIXER. After mixer runs for 1 minute,
THEN close the water valve.

The use of the step time variable as a successor transition condition guarantees that: the previous step stays
active for a set amount of time.

WASH_MIXER

: = TRUE

STEP1 S WATER_VLV

: = WASH_MIXER.STEP1.T>=T#0d0h0m5s0ms

STEP2 N MIXER

: = WASH_MIXER.STEP2.T>=T#0d0h1m0s0ms

STEP3 R WATER_VLV

January 1997 5-7


ACTION ELEMENTS CG39-27

5.3.3 R (Overriding-Reset)

The R (Overriding-Reset) qualifier determines that the Action becomes inactive when the action block input
becomes TRUE, as shown in Figure 5-7. The R qualifier may be used for any active Action and must be used
if the last Action enabled action block involved as store (S, SL, SD and DS) before the Action can be enabled
again. If the R qualifier is used with a boolean variable, the boolean variable is set to FALSE even if no
other action block had set it TRUE.

FIGURE 5-7 Overriding-Reset Action Qualifier

5-8 January 1997


CG39-27 ACTION ELEMENTS

5.3.4 P (Pulse)

The P (Pulse) qualifier determines that the Action is active for the single scan in which the block input
transitions from FALSE to TRUE as shown in Figure 5-8. For additional details, refer to Using the
4-mation Configuration Software (document number CG39-20).

FIGURE 5-8 Pulse Action Qualifier

Example:
Initialize a PID block.

STEP3 P FIC100_INIT

January 1997 5-9


ACTION ELEMENTS CG39-27

5.3.5 L (Time Limited)

The L (Time Limited) qualifier determines that the Action becomes active when the action block input
becomes TRUE as shown in Figure 5-9. When either a set length of time T has elapsed, or when the block
input turns FALSE, the block becomes inactive.

Q
T T

FIGURE 5-9 Time Limited Action Qualifier

Example:
When the level (LT300) is equal to or greater than 30 feet, open the solenoid valve VLV300 for 30 seconds
(T#0d0h0m30s0ms), or until the level falls below 30 feet, whichever is shorter.

L
%LT300 >= 30.0 %VLV300
T#0d0h0m30s0ms

5-10 January 1997


CG39-27 ACTION ELEMENTS

5.3.6 SL (Stored & Time Limited)

The SL (Stored & Time Limited) qualifier determines that the Action becomes active when the action block
input turns TRUE, as shown in Figure 5-10. After a set length of time has elapsed, or an R qualified action
block that references the same Action becomes TRUE, the Action is disabled. Before this action block can be
used again, an R qualified action block must be used. If this is not done, the Action cannot be enabled.

Q
T T

FIGURE 5-10 Stored and Time Limited Action Qualifier

Example:
When the level (LT300) is equal to or greater than 30 feet, open the solenoid valve VLV300 for 30 seconds,
or until the level is equal to or less than 20 feet, whichever is shorter.

%LT300 >= 30.0 SL


%VLV300
T#0d0h0m30s0ms

%LT300 <= 20.0 R %VLV300

January 1997 5-11


ACTION ELEMENTS CG39-27

5.3.7 D (Time Delayed)

The D (time Delayed) qualifier delays the enabling of an Action for a set time after the action block input first
turns TRUE, as shown in Figure 5-11. The Action is only enabled until the input becomes FALSE.

Q
T T

FIGURE 5-11 Time Delayed Action Qualifier

Example:
Open the solenoid valve immediately but do not start the pump until 20 seconds later in order to avoid
cavitation. Only keep the pump running until the STOP button is pressed (successor transition is TRUE).

STEP6 S %VLV300

D %PMP300
T#0d0h0m20s0ms

:= STOP

STEP7 N ACTION_7

5-12 January 1997


CG39-27 ACTION ELEMENTS

5.3.8 SD (Stored & Time Delayed)

The SD (Stored &Time Delayed) qualifier delays the enabling of an Action for a set time after the action
block input first turns TRUE, as shown in Figure 5-12. The Action stays enabled until an R qualified action
block that references the same Action becomes TRUE.

Before this action block can be used again, an R qualified action block must be used. If this is not done, the
Action will not be enabled.

Q
T

FIGURE 5-12 Stored and Time Delayed Action Qualifier

Example:
When the level (LT300) is equal to or greater than 30 feet, open the solenoid valve immediately but do not
start the pump until 20 seconds later in order to avoid cavitation. Keep the pump running until the level is
equal to or less than 20 feet.

%LT300>= 30.0 S %VLV300

SD
%PMP300
T#0d0h0m20s0ms

%LT300<=20.0 R %PMP300

January 1997 5-13


ACTION ELEMENTS CG39-27

5.3.9 DS (Delayed & Stored)

The DS (Delayed & Stored) qualifier delays the enabling of the Action for a set time after the action block
input first becomes TRUE, but the input must remain TRUE for the set time in order for the Action to be
enabled, as shown in Figure 5-13.
Once enabled, the Action stays enabled until an R qualified action block that references the same Action
becomes TRUE.

Q
T T

FIGURE 5-13 Delayed and Stored Action Qualifier

Example:
When the level (LT300) is equal to or greater than 30 feet, open the solenoid valve VLV300 immediately.
Start the pump 20 seconds later (in order to avoid cavitation) ONLY IF the action block input is still TRUE.
Keep the pump running until the level is less than or equal to 20 feet.

%LT300>= 30.0 S %VLV300

DS
%PMP300
T#0d0h0m20s0ms

%LT300<=20.0 R %PMP300

5-14 January 1997


CG39-27 ACTION ELEMENTS

5.4 ACTIONS ON A FUNCTION BLOCK DIAGRAM NETWORK

Action blocks can be placed anywhere on a function block diagram, however, the input to an action block
must be a boolean value (a function block output, a boolean variable, or a boolean constant). The state of the
boolean input is propagated to the connecting output wire.

%PMP200 AND %PMP100 N MOTOR_ON START OK1

N MOTOR_OFF STOP

Note that the action block at the top of the stack (MOTOR_ON) is displayed with an output. The stacked
action blocks (MOTOR_OFF) below the top block, however, do not have outputs (see section 5.6).

The action blocks are obtained in the Function Block language by selecting the NEXT [F10] Icon from the
main Icon Bar, and then selecting the ACTIONS [F7] Icon from the next Icon Bar. See Figure 5-14.

It is permissible for an action block to be present on a Function Block Sheet, yet not be connected to a
Function Block or a Boolean variable. Action Blocks that are not connected to anything, however, will never
be executed.

January 1997 5-15


ACTION ELEMENTS CG39-27

Icon Bar

Icon Bar

Icon Bar

00001117

FIGURE 5-14 Function Block Diagram Icon Bar

5-16 January 1997


CG39-27 ACTION ELEMENTS

5.5 ACTIONS ON A SEQUENTIAL FUNCTION CHART NETWORK

Each step in a sequential function chart (SFC) is capable of having an associated Action or Actions. The
Action associated with a step is shown within an action block to the right of the step that is connected to the
step by a line. This is shown in Figure 5-15. Note that the action blocks do not have outputs when being used
in SFCs.

S3 N MOTOR_ON START

N MOTOR_OFF STOP

FIGURE 5-15 Action Concatenation

The action blocks are obtained in the SFC language by selecting the ACTIONS [F5] Icon from the main Icon
Bar, as represented in Figure 5-16.

It is permissible for an action block to be present in the SFC language, yet not be connected to a step. Action
blocks that are not connected to steps, however, will never be executed.

Icon Bar

00001118

FIGURE 5-16 Sequential Function Chart Language Icon Bar

January 1997 5-17


ACTION ELEMENTS CG39-27

5.6 ACTION CONCATENATION

Action blocks located on either function block diagrams or sequential function chart networks can be
concatenated - meaning that more than one Action can accept the same boolean input value.

These Actions are stacked and can be moved to or placed anywhere on the sheet as long as the input is
connected to a block or step. Refer to the example of concatenation in Figure 5-15. If an action block is
removed from the middle of a stack, then the action blocks below it will cease to be associated. Another
action block must be manually inserted or the disassociated Actions must be repositioned.

Action blocks used for concatenation do not have inputs and must therefore be restricted to selections [F2]
and [F4] on the action block Icon Bar, as shown in Figure 5-17.

Icon Bar

00001119

FIGURE 5-17 Action Block Icon Bar

When Actions are concatenated, the stacked Actions have multiple feedback variables, but only a single
boolean input variable which acts simultaneously on all of the concatenated blocks.

5-18 January 1997


CG39-27 ACTION ELEMENTS

5.7 ACTION EXECUTION

Executing an Action is not the same as executing an action block. Each action block is executed every scan in
the same order as any other graphical element. Executing an action block involves examining the action
qualifier and the enabling condition, and setting the action flag. After thesSheet or SFC network has been
completely evaluated, these action flags are examined to determine which Actions are to be executed.

There are two phases of Action execution. The first phase is known as action post-scan. During action,
post-scan Actions that have just this scan been disabled, are run. For Boolean Actions, it is during this post-
scan execution that the boolean variable is set from TRUE to FALSE. Non-Boolean Actions can use this
scan for executing resetting logic. This execution is marked by the action flag value being FALSE. After all
Actions that require post-scan have been executed, enabled Actions will be executed.

IMPORTANT

With the exception of separate execution of post-scan actions and normal


scan action, no assumptions should be made about the order of execution of
Actions.

When action blocks are used within SFCs or within action bodies, additional terms are added invisibly to the
enabling conditions. Certain SFC modes, TRACE and OFF, force all action block enabling conditions within
the SFC to FALSE. The enabling conditions for action blocks within an action body that is disabled is set to
FALSE. This particular rule is important for understanding what may happen while post-scanning an Action.

Actions should be created to accomplish a single highly coherent purpose. If this is done, then Actions will
be independent of each other. This independence is important since Actions do not affect the execution of
the Sheet that contains the action block that enables the Action; Actions can and do effect other Actions that
are executed subsequently. The separation of post-scan execution from normal scan execution implies that
no ordering of Action will be absolute.

In Figure 5-18, when STEP1 becomes active, STEP1.X will become TRUE and the associated Action will be
scheduled to execute after the steps and transitions have been evaluated (but during the same scan cycle).
The transition following STEP1 will not be TRUE during the scan cycle that STEP1.X became TRUE (the
transitions are evaluated before the Actions are executed). The controller will, instead, complete the scan of
the sheet that the SFC is on, then the Actions will be executed. The next scan cycle that follows will set the
transition condition := %VALVE_101 to TRUE.

January 1997 5-19


ACTION ELEMENTS CG39-27

CHART_1

: = TRANSIT1

STEP1 N %VALVE_101

: = %VALVE_101

STEP2 N ACTION_2

FIGURE 5-18 Step Transition

The result of one Action will, however, affect any other Actions that are executed after it. An example of
this is shown in Figure 5-19.

CHART_2

: = TRANSIT1

STEP_1A N VAR_1 STEP_1B S ACTION_1 DONE

: = VAR_1

.
.
.

FIGURE 5-19 Example of One Action Affecting Another

5-20 January 1997


CG39-27 ACTION ELEMENTS

In this example, the steps and transitions will be evaluated first and the Actions will be placed in a queue The
Boolean Action VAR_1 will be evaluated before the non-Boolean Action ACTION_1. As a result, the
VAR_1 Action would affect ACTION_1 if the VAR_1 variable was utilized in the body of ACTION_1 (note
that both Actions are active during the same scan).

The scanning sequence of Actions is particularly important to keep in mind for SFCs and ladder logic.

January 1997 5-21


ACTION ELEMENTS CG39-27

5.8 ON-LINE DATA DISPLAY

In the on-line mode, all action blocks that are associated with active Actions will be displayed in the
configured ON color. To define the ON and OFF color, refer to Using the 4-mation Configuration
Software(document number CG39-20).

The state of the input of the action block will change based on the state of the connection to the left of the
block. The state of the action block itself, however, updates based on the state of the action flag variable.

Example:
The Action input changes from FALSE to TRUE, and the action qualifier is P (Pulse). The on-line mode will
show the value of the action block input and output to be TRUE (remember that the state of the output is the
same as the state of the input - at all times). The action block itself, however, will only indicate the ON state
for one controller scan due to the pulse action qualifier. (Since the pulse is only on for one controller cycle,
the ON state may not be visible from 4-mation.)

P (Pulse):

ALM1 AND ALM2 P FIC200_INIT

In on-line 4-mation, action blocks in the ERROR state are displayed in red. Errors are caused by two or more
action blocks trying to enable one Action in the same scan. To clear the error from the Main Menu Bar, select
On-Line, Clear Action Error.

5-22 January 1997


CG39-27 ACTION ELEMENTS

5.9 ACTION EXAMPLE

This section presents an Action example. The example is to perform an emergency shutdown sequence if, and
only if, certain conditions are TRUE. The conditions to test for are: FIC200 controller in Auto mode,
ALARM1 high due to high flow FT200, AND high level LT400. Once the shutdown Action is started, it
must continue until the shutdown is complete - it must not stop when one or more of the tested conditions
clear. The shutdown procedure must not be able to restart again until the EMERG_COND has cleared.

Since the shutdown sequence is to only be executed under certain conditions and not each controller scan, the
shutdown sequence must be configured as an Action or as an SFC with the above conditions used as the first
transition condition. Two functionally equivalent solutions are shown to demonstrate the flexibility of action
blocks. Solution A illustrates conditional execution using action blocks, while solution B uses action blocks
within an SFC.

Solution A:
Since the Action is to continue executing until complete, an action qualifier is used to begin the shutdown.
The reset of the Action can be triggered when the EMERG_COND has cleared and the DONE Boolean
variable indicates that the shutdown is complete. Note that if the clearing of the EMERG_COND is not used
as a condition to restart the shutdown sequence, the EMERG_SHUTDWN sequence would be performed
continuously as long as the EMERG_COND remains TRUE - This may not be a desirable feature. Figure 5-
20 represents the function block language configuration portion.

PID_EXTSP

%FT200 PV OUT %VLV200 AND

45.0 EXTSP AUTO FIC200_AUTO IN01 OUT EMERG_COND S EMERG_SHUTDWN DONE

ALM1 HIGH_FT200 IN02

IN03

%LT400>= 30.0

-EMERG_COND AND DONE R EMERG_SHUTDWN

R %VLV_400

FIGURE 5-20 Solution A: Function Block Language Configuration

January 1997 5-23


ACTION ELEMENTS CG39-27

Figure 5-21 represents the body of the Action EMERG_SHUTDWN written in sequential function chart
language.

DIVERT_STEP N DIVERT DIVERTED

: = DIVERTED

OPEN_VLV S %VLV_400

: = %VLV_400

FINISH P DONE
.

FIGURE 5-21 Body of EMERG_SHUTDWN Action

Solution B:
Figure 5-22 represents the function block configuration portion of the solution.

FIC200

PID_EXTSP EMERG_DOWN

%FT200 PV OUT %VLV200 USER_DEF_1

45.0 EXTSP AUTO FIC200_AUTO COND1

ALM1 HIGH_FT200 COND2

COND3

%LT400>= 30.0

FIGURE 5-22 Solution B, Function Block Language Configuration

5-24 January 1997


CG39-27 ACTION ELEMENTS

Figure 5-23 represents the body of UDFB EMERG_DOWN written in the sequential function chart
language.

EMERG_DOWN

: = [COND1] & [COND2] & [COND3]

DIVERT N DIVERT DIVERTED

: = DIVERTED

OPEN_VLV S %VLV_400

: = - [COND1] & [COND2] & [COND3]

FINISH R %VLV_400
.

: = TRUE

FIGURE 5-23 Body of EMERG_DWN User Defined Block

Note that the conditions 1, 2 and 3 have square brackets around the variable names. These brackets
indicate that the variables are passed via the inputs (COND1, COND2, COND3) to the User Defined
Block. If this SFC had been created as the body of an action block, the SFC would be on the same
hierarchical level as the action block and the square brackets around the condition variables would
not be required.

January 1997 5-25


ACTION ELEMENTS CG39-27

5-26 January 1997

Вам также может понравиться