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

Logic Developer - PC: SFC Instructions

SFC instructions are the building blocks an SFC is composed of. Each
instruction can be inserted in a cell with a specific tool, dragged from the SFC
drawer of the Toolchest or by typing a mnemonic when using the Quick
Edit method.
Note: Additional mnemonics are available that do not correspond directly to a single SFC
instruction.

Tool Instruction Mnemonic Comment


Initial Step IS A multi-action instruction that must be
the first instruction in an SFC. A
Transition is automatically inserted after
an Initial Step.
Step SP A multi-action instruction.
Macro Start MS A multi-action instruction. Must be the
first instruction in an SFC macro. A
Transition is automatically inserted after
a Macro Start.
Macro End ME A multi-action instruction. Must be the
last instruction in an SFC macro.
Macro Step MA Inserts a macro in a SFC.
Transition TR A conditional controlling SFC execution.
Jump JU Transfers execution to a step in the
current SFC or macro.
Parallel Converge PC Joins the paths created by a Parallel
Diverge.
Parallel Diverge Splits a single execution path into two
PD
or more, all of which will be solved.
Branch Diverge BD Splits a single execution path into two
or more, only one of which will be
solved.
Branch Converge BC Joins the paths created by a Branch
Diverge.
Text TE A cell in which you type commentary.
Vertical VE Connects the end points of instructions.

Additional Mnemonics
The following mnemonics are also available to provide enhanced flexibility
when using the Quick Edit method.

Tool Mnemonic Comment


IC Inserts a column to the right of the currently selected cell.
IR Inserts a row above the currently selected cell.
n/a BR Complete Branch. Includes a Branch Converge, a Branch
Diverge, Steps and Transitions in each path.
n/a MT A Macro Step plus a Transition.
n/a ST A Step plus a Transition.
n/a PA Complete Parallel. Includes a Parallel Diverge, a Parallel
Converge, Steps on each path and a terminating
Transition.
Branch Converge (BC)

A Branch Converge joins the execution paths (two or more) created by a


Branch Diverge. Each execution path must end in a Transition before
converging. Only one of the divergent paths will be executed when the SFC is
solved (as determined at the divergence).
Note: It is not necessary to converge paths created by a Branch Diverge.
Tip: To add an additional path (more than the two initially inserted) to a Branch Converge, insert a
Branch Converge in the cell beside the original.
Branch Diverge (BD)

A Branch Diverge splits a single SFC execution path into two or more optional
paths, only one of which will be executed when the SFC is solved. Each
optional path must begin with a Transition. The left Transition is evaluated
first and the left path will be executed if the Transition is True. Otherwise, the
next path to the right will be executed (if the initial Transition for that path is
True) and so on. A BD instruction can only be placed immediately after a
multiaction instruction.
Notes:

● It is not necessary to converge paths created by a Branch Diverge.


● To add an additional path (more than the two initially inserted) to a Branch Diverge, insert a
Branch Diverge in the cell beside the original.
Initial Step (IS)

Properties

An Initial Step must be the first instruction in an SFC. It contains up to


four actions that execute sequentially when the SFC is solved by the
Controller. An active Initial Step is solved each scan until the Transition
following it is True. Then it is deactivated and solved once with negative
power flow before the instruction following the Transition is solved. Each
action in an Initial Step has a qualifier associated with it that is:

● P (Pulsed) - the action execute only once per activation of the Initial
Step it resides in.
● N (Normal) - the action executes each scan that the Initial Step it
resides in is active and executes once with negative power flow when
the Initial Step is deactivated.

An Initial Step has a STEP variable associated with it:

● 'Stepn.X' is a BOOL that is ON(1) while the Initial Step is active.


● 'Stepn.T' is a TIME that contains the time (ms) the Initial Step has been
active.

A STEP variable ('Stepn') can be automatically created (if the Auto-edit option
is False) when you insert an Initial Step. A text description of the Initial Step
is associated with the STEP variable and is displayed above the instruction if
the Show Description option is True.
Notes

● An Initial Step must be the first instruction in an SFC.


● An Initial Step must be followed by a Transition; one is automatically inserted when an Initial
Step is inserted.

Tips

● To choose or change the named action, click an action name box.


● To choose or change an action qualifier , click it.
● To choose or change the associated STEP variable, click the step name box.
● To edit a description, click it.

Initial Step Properties


The following properties specify the parameters for an Initial Step instruction.

Variable Name
The name of the STEP variable associated with an Initial Step instruction.

+Variable
The complete set of properties for a variable.

Qualifier (1 of 4)
Specifies when the associated action will execute. If the qualifier is:

● P (Pulsed) - the action executes only once per activation of the Initial
Step it resides in.
● N (Normal) - the action executes each scan that the Initial Step it
resides in is active.

Action (1 of 4)
The name of an action included in an Initial Step.
Jump (JU)

Properties

A Jump transfers SFC execution to the beginning of another instruction. The


STEP variable specified in a Jump instruction is the same one specified in
the instruction the execution transfers to. A Jump is typically used as the last
instruction in an SFC.
Note: You can only jump to steps within the current SFC or macro.
Tips

● To choose or change the destination of the Jump click it and choose a step variable from the
smart list that appears.
● To edit a description, click it.

Jump Properties
The following properties specify the parameters for a Jump instruction.

Destination
The name of the STEP variable associated with a Jump instruction. This
functions as a specifier for the destination of the Jump. That is, execution is
transferred to the instruction associated with the same STEP variable.
Macro End (ME)

Properties

A Macro End must be the last instruction in an SFC macro. It contains up to


four actions that execute sequentially when the SFC is solved. An active
Macro End is solved each scan until the Transition following the Macro Step
calling the macro is True. Then the Macro End is deactivated and solved once
with negative power flow before the instruction following the Transition is
solved. Each action in a Macro End has an action qualifier:

● P (Pulsed) - the action executes only once per activation of the Macro
End it resides in.
● N (Normal) - the action executes each scan while the Macro End it
resides in is active and will execute with negative power flow when the
Macro End is deactivated.

A Macro End has a STEP variable associated with it :

● 'Stepn.X' is a BOOL that is ON(1) while the step is active.


● 'Stepn.T' is a TIME that contains the time (ms) the step has been active.

A STEP variable ('Stepn') can be automatically created (if the Auto-edit option
is False) when you insert a Macro End. A text description of the Macro End is
associated with the STEP variable and is displayed above the instruction if the
Show Description option is True.
Note: A Macro End must be the last instruction in a macro .
Tips

● To choose or change the named action, click an action name box.


● To choose or change an action qualifier, click it.
● To choose or change the associated STEP variable, click the step name box.
● To edit a description, click it.

Macro End Properties


The following properties specify the parameters for a Macro End instruction.

Variable Name
The name of the STEP variable associated with an Macro End instruction.

+Variable
The complete set of properties for a variable.

Qualifier (1 of 4)
Specifies when the associated action will execute. If the qualifier is:

● P (Pulsed) - the action executes only once per activation of the Macro
End it resides in.
● N (Normal) - the action executes each scan that the Macro End it
resides in is active.

Action (1 of 4)
The name of an action included in an Macro End.
Macro Start (MS)

Properties

A Macro Start must be the first instruction in an SFC Macro. It contains up


to four actions that execute sequentially. An active Macro Start is solved each
scan until the Transition following it is True. Then it is deactivated and solved
once with negative power flow before the instruction following the Transition
is solved. Each action in a Macro Start has an action qualifier:

● P (Pulsed) - the action executes only once per activation of the Macro
Start it resides in.
● N (Normal) - the action executes each scan while the Macro Start it
resides in is active and will execute with negative power flow when the
Macro Start is deactivated.

A Macro Start has a STEP variable associated with it:

● 'Stepn.X' is a BOOL that is ON(1) while the step is active.


● 'Stepn.T' is a TIME that contains the time (ms) the step has been active.

A STEP variable ('Stepn') can be automatically created (if the Auto-edit option
is False) when you insert a Macro Start. A text description of the Macro Start
is associated with the STEP variable and is displayed above the instruction if
the Show Description option is True.

Notes

● A Macro Start must be the first instruction in a macro .


● A Transition must follow a Macro Start and one is automatically inserted when a Macro Start
is inserted.

Tips

● To choose or change the named action, click an action name box.


● To choose or change an action qualifier , click it.
● To choose or change the associated STEP variable, click the step name box.
● To edit a description, click it.

Macro Start Properties


The following properties specify the parameters for a Macro Start instruction.

Variable Name
The name of the STEP variable associated with a Macro Start instruction.

+Variable
The complete set of properties for a variable.

Qualifier (1 of 4)
Specifies when the associated action will execute. If the qualifier is:

● P (Pulsed) - the action executes only once per activation of the Macro
Start it resides in.
● N (Normal) - the action executes each scan that the Macro Start it
resides in is active.

Action (1 of 4)
The name of an action included in an Macro Start.
Macro Step (MA)

Properties

A Macro Step places the specified macro inline for execution in an SFC. The
macro executes (one step per scan) until a Macro End is reached. An active
Macro End repeats each scan until the Transition following the Macro Step is
True, then the Macro End is solved once with negative power flow before
execution continues with the instruction following the Transition.
A Macro Step has a STEP variable associated with it:

● 'MStepn.X' is a BOOL that is ON(1) while the Macro Step is active.


● 'MStepn.T' is a TIME that contains the time (ms) the Macro Step has
been active.

A STEP variable ('MStepn') can be automatically created (if the Auto-edit


option is False) when you insert an Macro Step. A text description of the
Macro Step is associated with the STEP variable and is displayed above the
instruction if the Show Description option is True.
The name of the specified macro is required.
Notes

● A Macro Step cannot be the first instruction in an SFC or a Macro.


● A Transition must follow a Macro Step.

Tips

● To choose or change the named macro, click the macro name box.
● To choose or change the associated STEP variable, click the step name box
● To edit a description, click it .
Macro Step Properties
The following properties specify the parameters for a Macro Step instruction.

Variable Name
The name of the STEP variable associated with the Macro Step instruction.

+Variable
The complete set of properties for a variable.

Macro Name
The name of the SFC macro that is placed inline for execution by the Macro
Step.
Parallel Converge (PC)

A Parallel Converge joins two or more execution paths created by a Parallel


Diverge. The last instruction in each converging path must be a Step or
Macro Step. The instructions in both paths must be completed before SFC
execution proceeds. A Transition must follow a Parallel Converge. If the
associated transition variable is OFF(0) the last steps in both converging
paths are executed again.
Note: All paths created by a Parallel Diverge must converge.
Tip: To add an additional path (more than the two initially inserted) to a Parallel Converge, insert
another Parallel Converge in the cell beside the original.
Parallel Diverge (PD)

A Parallel Diverge splits an SFC execution path into two or more paths that
will execute simultaneously (during the same scan) when the SFC is solved.
That is, the left path is solved, then the next path to the right and so on). A
Parallel Diverge must be preceded by a Transition. The first instruction on
each divergent path must be a Step or Macro Step.
Note: All paths created by a Parallel Diverge must converge.
Tip: To add an additional path (more than the two initially inserted) to a Parallel Diverge, insert
another Parallel Diverge in the cell beside the original.
Step (SP)

Properties

A Step contains up to four actions that execute sequentially. An active Step is


solved each scan until the Transition following it is True. Then it is
deactivated and solved once with negative power flow before the instruction
following the Transition is solved. Each action in a Step has an action
qualifier:

● P (Pulsed) - the action executes only once per activation of the Step it
resides in.
● N (Normal) - the action executes each scan while the Step it resides in
is active and will execute with negative power flow when the Step is
deactivated.

A Step has a STEP variable associated with it:

● 'Stepn.X' is a BOOL that is ON(1) while the Step is active.


● 'Stepn.T' is a TIME that contains the time (ms) the Step has been
active.

A STEP variable ('Stepn') can be automatically created (if the Auto-edit option
is False) when you insert a Step. A text description of the Step is associated
with the STEP variable and is displayed above the instruction if the Show
Description option is True.
Notes

● A Step cannot be the first instruction in an SFC or a Macro.


● A Transition must follow a Step.
Tips

● To choose or change the named action, click an action name box.


● To choose or change an action qualifier, click it.
● To choose or change the associated STEP variable, click the step name box.
● To edit a description, click it.

Step properties
The following properties specify the parameters for a Step instruction.

Variable Name
The name of the STEP variable associated with a Step instruction.

+Variable
The complete set of properties for a variable.

Qualifier (1 of 4)
Specifies how the associated action will execute. If the qualifier is:

● P (Pulsed) - the action executes only once per activation of the Step it
resides in.
● N (Normal) - the action executes as each scan the Step it resides in is
active.

Action (1 of 4)
The name of an action included in an Step.
Text (TE)

The Text instruction is used to create cells in an SFC where you can type
descriptions or commentary. Any unoccupied cell can be converted to a Text
cell.
Transition (TR)

Properties | Transition Logic

or
A Transition is a conditional instruction that determines if the preceding
instruction repeats or the following instruction is solved by the controller.
Each Transition has a BOOL variable or ST BOOL Transition logic associated
with it. The instruction following a Transition executes only if the BOOL
variable or the Transition logic resolves to ON(1). A text description of the
Transition is associated with the BOOL variable or the Transition logic and is
displayed above the instruction when the Show Description option is set to
True.
Notes

● Initial Step, Step, Macro Start and Macro Step instructions (multi-action instructions) must
be followed by a Transition.
● A Transition cannot be the first instruction in an SFC or Macro.

Tip: To choose or change the BOOL variable or ST BOOL logic assigned to a Transition, click on
the lower right of the instruction (where the variable name or Transition logic appears).

Transition Logic
Structured Text Transition logic must always resolve to a BOOL value. The
logic can also contain DINT variables or LREAL variables but not both.
Warning: Comparing LREAL values may produce unexpected results. For example, a calculation
may result in 1.99999999999, which is not equal to 2.00000000000.

Example 1
myBOOL AND myBOOL2

Example 2
NOT(myDint > myDint2 OR myDint3 <= myDint4)
Note: Transition logic can't contain:
❍ Semicolon ';'.
❍ Assignment ':=' operator.

See ST BOOL logic for more examples.


For each ST BOOL Transition logic, a BOOL Transition variable is created and
associated with the Transition. This logic is in the form:
BOOL Transition variable name := DINT variable name or LREAL variable
name;
- or -
BOOL Transition variable name := ST BOOL logic;

From the diagram, the following Transition logic is created:


Step ST Logic

Step1 Trans1 := Trans1;

Step2 Trans2 := (myDint > 10 AND myDint2 < 100);

Step3 Trans3 := myDint > 100;

Note: You can:


● Change the Transition variable to which the logic is assigned by selecting the Transition and
changing its Variable Name property in the Property Inspector.
● Force the values of BOOL Transition variables (Trans1, Trans2, Trans3 from the diagram) to
be ON (1) or OFF (0).
● Delete a Transition variable by first deleting the Transition to which it belongs, then deleting
the variable.

Transition Properties
The following properties specify the parameters for a Transition instruction.

Variable Name
The name of a BOOL variable associated with a Transition instruction. If ST
BOOL Transition logic is used, a BOOL variable is automatically created and
stores the result of the Transition logic.

+Variable
The complete set of properties for a variable.
Vertical (VE)

A Vertical is used to extend connection points between SFC instructions.