ON
Syntax
ON <BOOL expression> DO
<statements>
END_DO;
Remarks
-
-
This instruction is NOT UDFB "User Defined Function Block" UDFB can be used as a sub-function block in another program of the application. It is described using FBD, LD, ST or IL language. Input / output parameters of a UDFB (as well as private variables) are declared in the variable editor as local variables of the UDFB safe.
Do not use inside UDFBs.
- The ON instruction:
- Provides a simpler syntax for checking the rising edge A rising edge is the transition of a digital signal from low to high. It is also called positive edge of a Boolean condition.
- Avoids systematic use of the R_TRIG function block or other "last state" flags.
- Statements within the ON structure are executed only when the Boolean expression rises from FALSE to TRUE.
- The ON syntax is available in any program or sub-program.
- This statement is an extension to the standard and is NOT IEC "International Electrotechnical Commission" IEC is a not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies 61131-3 compliant.
FBD Language Example
Not available.
FFLD Language Example
Not available.
IL Language Example
Not available.
ST Language Example
(* This example counts the rising edges of variable bIN *) ON bIN DO
diCount := diCount + 1;
END_DO;