ON
Syntax
ON <BOOL expression> DO
<statements>
END_DO;
Remarks
- 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.
- Statements within the ON structure are executed only when the Boolean expression rises from FALSE to TRUE.
- The ON instruction avoids systematic use of the R_TRIG function block or other "last state" flags.
- 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.
-
-
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.
FBD Language
Not available.
FFLD Language
Not available.
IL Language
Not available.
ST Language
(* This example counts the rising edges of variable bIN *) ON bIN DO
diCount := diCount + 1;
END_DO;