FEDGE
Typing FEDGE evaluates the falling edge of a Boolean expression.
TIP:
The IEC 61131-3 standard does not include the FEDGE
operator.
FEDGE Operator | |
---|---|
Name | FEDGE |
Syntax | <edge> := FEDGE ( <boo_expression>, <memo_variable> ); |
Operands | First operand is any Boolean variable or complex expression Second operand is an internal Boolean variable used to store the last state of the expression |
Return value | TRUE when the expression changes from TRUE to FALSE FALSE for all other cases |
TIP:
Trigger edges for an expression with a variable other
than the memory Boolean variable that stores the last state of the expression.
When the expression is a Boolean variable, declare a unique internal variable with same
name and the EDGE_prefix for use in the FEDGE expressions for the variable. This internal
variable prevents other FEDGE operations from overwriting the memory variable.
Example
(* ST program using FEDGE operator *) (* this program counts the falling edges of a Boolean input *) (*Bi120 is an input Boolean variable *) (* Edge_Bi120 is the memory of the Bi120 variable state *) If FEDGE (Bi120, Edge_Bi120) Then Counter := Counter + 1; End_if;
Provide Feedback