An EN input and an ENO output can be configured for the FFBs.
If the value of EN is equal to "0" when the FFB is invoked, the algorithms defined by the FFB are not executed and ENO is set to "0".
If the value of EN is equal to "1" when the FFB is invoked, the algorithms defined by the FFB will be executed. After the algorithms have been executed successfully, the value of ENO is set to "1". If certain error conditions are detected when executing these algorithms, ENO is set to "0".
If the
EN pin is not assigned a value, when the FFB is invoked, the algorithm defined by the FFB is executed (same as if
EN equals to "1"), Please refer to
Maintain output links on disabled EF.
If the algorithms are executed successfully, then value of ENO is set to "1", else ENO is set to "0".
If ENO is set to "0" (caused by EN=0 or a detected error condition during execution or unsuccessful algorithm execution):
-
Function blocks
-
EN/ENO handling with function blocks that (only) have one link as an output parameter:
If EN from FunctionBlock_1 is set to "0", the output connection OUT from FunctionBlock_1 retains the status it had in the last correctly executed cycle.
-
EN/ENO handling with function blocks that have one variable and one link as output parameters:
If EN from FunctionBlock_1 is set to "0", the output connection OUT from FunctionBlock_1 retains the status it had in the last correctly executed cycle. The variable OUT1 on the same pin, either retains its previous status or can be changed externally without influencing the connection. The variable and the link are saved independently of each other.
-
Functions/Procedures
NOTE: Unity Pro is the former name of Control Expert for version 13.1 or earlier.
NOTE: With Unity Pro V4.0 and earlier versions the deactivation of an EF (EN=0) causes links connected to its Input/Output to be reset. To transfer the state of the signal do not use a link. A variable must be connected to the EF’s output and must be used to connect the input of the element. With Unity Pro V4.1 and later versions you can maintain the output links even if an EF is deactivated by activating the option Maintain output links on disabled EF (EN=0) via the menu Tools → Program → Languages → Common.
As defined in IEC61131-3, the outputs from deactivated functions (EN-input set to "0") is undefined. (The same applies to procedures.)
Here is an explanation of the output status in this case:
-
EN/ENO handling with functions/procedures that (only) have one link as an output parameter:
If EN from Function/Procedure_1 is set to "0", the output connection OUT from Function/Procedure_1 is also set to "0".
-
EN/ENO handling with function blocks that have one variable and one link as output parameters:
If EN from Function/Procedure_1 is set to "0", the output connection OUT from Function/Procedure_1 is also set to "0". The variable OUT1 on the same pin, either retains its previous status or can be changed externally without influencing the connection. The variable and the link are saved independently of each other.
The output behavior of the FFBs does not depend on whether the FFBs are called up without EN/ENO or with EN=1.
Conditional/Unconditional FFB Call
"Unconditional" or "conditional" calls are possible with each FFB. The condition is realized by pre-linking the input EN.
-
EN connected
conditional calls (the FFB is only processed if EN = 1)
-
EN shown, hidden, and marked TRUE, or shown and not occupied
unconditional calls (FFB is processed independent from EN)
NOTE: For disabled function blocks (EN = 0) with an internal time function (e.g. DELAY), time seems to keep running, since it is calculated with the help of a system clock and is therefore independent of the program cycle and the release of the block.
The use of EN and ENO is only possible in the text languages for a formal FFB call, e.g.
MY_BLOCK (EN:=enable, IN1:=var1, IN2:=var2,
ENO=>error, OUT1=>result1, OUT2=>result2);
Assigning the variables to ENO must be done with the operator =>.
With an informal call, EN and ENO cannot be used.