-

Execution Control: EN/ENO

This help chapter contains the following information:

General Information on Execution Control with EN/ENO

EN/ENO allows an optional conditional execution of functions and function blocks according to the IEC 61131-3 standard. EN is an enable input, ENO an enable output formal parameter. Their functionality is described below.

To insert POUs with EN/ENO parameters into worksheets by default, the appropriate checkboxes must be activated in the 'Options' dialog under the 'EN/ENO' category (see section below).

Note
This setting only affects the insertion of POUs with or without EN/ENO parameters. Regardless of this setting, the conditional execution is always considered during runtime if EN/ENO formal parameters are used in the code.

POUs with and without EN/ENO can run at the same time in one worksheet/project.

EN/ENO is available...

In the current PLCnext Engineer version, EN/ENO is not available for firmware function blocks which are included by default with the programming system (including safety-related PLCopen function blocks). For these blocks, the correct block execution can be monitored by evaluating the corresponding status/error output(s). Furthermore, methods (of object-oriented FBs) do not support EN/ENO.

Behavior of EN/ENO

The POUs listed above provide an EN input and an ENO output. These formal parameters are used to control the execution of the POU. If the insertion of POUs with EN/ENO feature is activated, a newly inserted POU (which supports the EN/ENO feature) provides the EN/ENO formal parameters by default.

Formal parameterMeaning
ENBoolean input formal parameter that enables the execution of the POU:
  • TRUE: POU will be executed. If the POU executes without errors, the ENO output is set to TRUE.
  • FALSE: POU will not be executed. The ENO output is set to FALSE.

    If EN = FALSE, the last valid output value when EN switches to FALSE will be kept (observe the following note). (Does not apply for structs and arrays.)

    Even if EN = FALSE, the subsequent POUs (connected to the other outputs than ENO of the "idle" POU) are executed anyway (unless they are also switched idle by their EN = FALSE).

    Note
    Functions inside other functions do not keep the last valid value when EN switches to FALSE. If a function calls another function inside and EN is later set to FALSE on the inner function, the last value of the inner function cannot be maintained. This is also the case if an inner function keeps the last value if an internal error occurs.

EN may remain unconnected. In this case, for standard IEC 61131-3 functions the input value TRUE is assumed and ENO shows a statical TRUE provided there is no internal error which causes setting ENO to TRUE.
ENOBoolean output formal parameter which indicates whether the POU is executed correctly.

ENO may remain unconnected.

Most of the standard FUs/FBs react as follows. Also observe the note below.
  • TRUE: POU has been executed because EN = TRUE or unconnected. No errors occurred during execution and the values applied at its outputs are correct.
  • FALSE: This may have one of the following reasons.
    • POU has not been executed because EN = FALSE, or
    • an error occurred during the block execution (such as division by zero or output data type range exceeded).
By connecting the EN inputs of further POUs or other code elements to the ENO output, the further execution of the program will depend on the error-free execution.

Example in FBD: conditional execution of two subsequent functions

In ST code, the EN input and the ENO output are already included as placeholders when inserting a function from the COMPONENTS area via drag & drop (if activated). In the call statement, these parameters can directly be assigned to variables.

Examples in ST...