Download Operation Manual SFC Programming

Transcript
Section
Elements of SFC
2-3
Boolean Action (Bit)
Boolean Variable
A transition condition can be defined using a Boolean variable name.
Example: In the case of “bFlag”, the condition is met when “bFlag” is ON.
Actual Address (Bit)
A transition’s condition can be defined using an actual address (bit).
ST Expression
A transition condition can be defined using an ST expression.
Formats for ST-programmed condition equations are listed below:
Formats for Boolean Variables in Defining Transitions with ST Expressions
Operator
Name
Parenthesis
Operator
Example
Details
()
(a & b) OR c
Complement
AND
Exclusive OR
OR
Equality
NOT
AND, &
XOR
OR
=
NOT bFlag
a&b
a XOR b
a OR b
a=b
Condition met if both “a” and “b” are ON, or if
“c” is ON
Condition met if bFlag is OFF
Condition met if both “a” and “b” are ON
Condition met if “a” differs from “b”
Condition met if “a” or “b” is ON
Condition met if “a” and “b” are the same
Formats for INT, DINT, LINT, UINT, UDINT, ULINT, CHANNEL, REAL, LREAL, WORD,
DWORD, LWORD, UINT_BCD, UDINT_BCD, and ULINT_BCD Variables in Defining
Transitions with ST Expressions
Operator
Name
Parenthesis
Operator
Example
Details
()
Condition met if nValue is 10 and “a” is ON
Comparison
Equality
Inequality
<, >, <=, >=
=
<>
(nValue = 10) &
a
nValue >= 10
nValue = 10
nValue <> 10
Condition met if nValue is 10 or greater
Condition met if nValue is 10
Condition met if nValue is not 10
Transition Program
Program names may be used as transition conditions.
A transition program can be coded using either Ladder or ST as the language.
In CX-Programmer, a transition condition is met when the Boolean variable with the
same name as the transition program is switched to “ON”.
Example 1: “b” bit for “a”
PRG
Any name
Transition Program Name
a
PRG
Condition met if “a” is OFF
51