EN-ENO Mechanism
EN-ENO Mechanism
Programming basics
Manual
V20
11/2024
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as
well as to prevent damage to property. The notices referring to your personal safety are
highlighted in the manual by a safety alert symbol, notices referring only to property damage
have no safety alert symbol. These notices shown below are graded according to the degree of
danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest
degree of danger will be used. A notice warning of injury to persons with a safety alert symbol
may also include a warning relating to property damage.
Qualified Personnel
WARNING
Siemens products may only be used for the applications described in the catalog and in the
relevant technical documentation. If products and components from other manufacturers are
used, these must be recommended or approved by Siemens. Proper transport, storage,
installation, assembly, commissioning, operation and maintenance are required to ensure
that the products operate safely and without any problems. The permissible ambient
2 Manual, 11/2024
conditions must be complied with. The information in the relevant documentation must be
observed.
Trademarks
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and
software described. Since variance cannot be precluded entirely, we cannot guarantee full
consistency. However, the information in this publication is reviewed regularly and any
necessary corrections are included in subsequent editions.
Siemens Aktiengesellschaft
Copyright © Siemens 2024.
Digital Industries
11/2024 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
Manual, 11/2024 3
Table of content
1 EN/ENO mechanism 6
1.1 Basics of the EN/ENO mechanism 6
1.2 EN/ENO mechanism in LAD 7
1.2.1 Overview of the EN/ENO mechanism in LAD 7
1.2.2 Enabling and disabling the EN/ENO mechanism in LAD and FBD 8
1.2.3 Influencing the block ENO of an LAD/FBD program block 9
1.2.4 Example of the use of the EN/ENO mechanism in LAD 10
1.3 EN-/ENO mechanism in FBD 11
1.3.1 Overview of the EN/ENO mechanism in FBD 11
1.3.2 Enabling and disabling the EN/ENO mechanism in LAD and FBD 12
1.3.3 Influencing the block ENO of an LAD/FBD program block 13
1.3.4 Example of the use of the EN/ENO mechanism in FBD 14
1.4 EN/ENO mechanism in STL (S7-1500) 16
1.4.1 Overview of the EN/ENO mechanism in STL (S7-1500) 16
1.4.2 Example of the simulation of the EN/ENO mechanism in STL (S7-1500) 17
1.5 EN/ENO mechanism in SCL 19
1.5.1 Overview of the EN/ENO mechanism in SCL 19
1.5.2 Enabling and disabling the property 'Set ENO automatically' in SCL 19
1.5.3 Using enable output ENO with SCL instructions 20
1.5.4 Influencing 'ENO' of an SCL block 21
1.5.5 Influencing ENO within a block 21
1.5.6 Example for using ENO in SCL 21
1.6 EN/ENO mechanism in GRAPH (S7-1500) 22
1.6.1 Overview of the EN/ENO mechanism in GRAPH (S7-1500) 22
1.6.2 Activating and deactivating EN/ENO mechanism in GRAPH (S7-1500) 23
1.6.3 Example of the EN/ENO mechanism in GRAPH (S7-1500) 23
1.7 EN/ENO mechanism in blocks with different network languages (S7-1200, S7-1500) 24
4 Manual, 11/2024
Manual, 11/2024 5
EN/ENO mechanism
The EN/ENO mechanism is already available in LAD and FBD for calling the simple and advanced
instructions in the program code.
With the EN/ENO mechanism you can influence the calling of the following instructions and
customize the jumping out from a program block using the instruction "RET: Return". At the
same time you can also assign an individual value (0 or 1) to the enable output ENO of the
program block. This behavior is generally used for LAD and FBD program blocks. You can also
use this procedure for SCL program blocks. You do not necessarily have to use the instruction
"RET" to influence the enable output ENO of the SCL program block.
At the network borders the enable output is repeatedly set to the signal state "1". In a LAD
program block you can recognize this, for example, by the fact that the left busbar always
supplies current, even when the enable output ENO of the last instruction of the previous
network returns the signal state "0".
6 Manual, 11/2024
Function of the instruction "RET: Return" (LAD/FBD)
When the result of logic operation = 0 the instruction is not executed and the next network is
processed.
When the result of logic operation = 1 the instruction is executed and a return to the calling
program block takes place.
The signal state of the block ENO can be determined with four options:
Operand: The signal state of the specified operand determines the block ENO.
To increase the performance, the EN/ENO mechanism is disabled by default for the instructions.
It can be enabled at any time also for individual instructions. For additional information on the
enabling and disabling of the EN/ENO mechanism, refer to: Enabling and disabling the EN/ENO
mechanism in LAD and FBD
For LAD/FBD program block the EN/ENO mechanism only works with an activated enable output
ENO at the respective instructions.
The enable output ENO has the signal state "1" if no error occurred during the execution.
Enable output ENO has the signal state "0" if one of the following conditions applies:
Manual, 11/2024 7
- An error occurred during processing.
The enable output ENO returns the signal state "1" when the program block is processed.
If, in the case of error, you do not explicitly set the enable output ENO within the called
program block to the signal state "0", it retains the signal state "1". Using the instruction
"RET: Return" you can set the block ENO to the signal state "0".
Additional information on using the RET instruction is available here: Influencing the block
1.2.2 Enabling and disabling the EN/ENO mechanism in LAD and FBD
In LAD and FBD, certain instructions have an enable output ENO and thus use the EN/ENO
mechanism. This allows you to query runtime errors in instructions and react to them. In order
to increase the performance of the CPU, the EN/ENO mechanism is disabled in the default
setting. This means that you are not initially able to react to runtime errors of the instruction
using the ENO value. However, you can enable the EN/ENO mechanism again at any time, if
required.
You can enable the EN/ENO mechanism individually for each instruction in order to generate the
ENO. If you enable the EN/ENO mechanism for an instruction, other instructions that you
subsequently add to your program are also inserted with the EN/ENO mechanism enabled. You
can disable the EN/ENO mechanism again at any time if you do not want to use the evaluation
of ENO for an instruction. Further instructions that you subsequently add to your program will
then be inserted without the EN/ENO mechanism.
Runtime errors do not cause the CPU to go to STOP when the enable output ENO is enabled.
1. In your program, right-click the instruction at which you want to activate the EN/ENO
mechanism.
The ENO value is again generated for the instruction. Additional instructions are then also
inserted with the activated enable output.
8 Manual, 11/2024
Deactivating the EN/ENO mechanism
Proceed as follows to deactivate the EN/ENO mechanism of an instruction:
1. In your program, right-click the instruction at which you want to deactivate the EN/ENO
mechanism.
2. Select the "Do not generate ENO" command from the shortcut menu.
The ENO value is no longer generated for the instruction. Additional instructions are then
See also
Basics of the EN/ENO mechanism
Description
Using the instruction "RET: Return" you jump out from a program block and hereby influence the
signal state of the ENO block.
Procedure
To influence the signal state of the block ENO, follow these steps:
1. Enable the EN/ENO mechanism of an instruction (for example, the addition "ADD").
2. Then use a negation to program the instruction "RET: Return" with signal state FALSE at the
Result
In case of error (for example, an overflow in the result), the signal state "0" is first returned at the
enable output ENO. This signal state "0" becomes signal state "1" using the negation and thus
forms the RLO = 1 for executing the instruction "RET", which returns the value FALSE. The block
ENO of the program block is hereby FALSE and a return takes place from the program block to
the next instruction after the previous program block call. This procedure can be programmed in
each network (for example, with multiple mathematical functions etc.).
However, it is not compulsory to program a jump out of the program block. Within a network
you can also use the signal state "0" of the enable output ENO of a single instruction to
determine that the subsequent instruction is not executed. The block ENO is not hereby
influenced.
Note
Influencing of the block ENO
You can only influence the signal state of the block ENO by jumping out of the
program block.
Manual, 11/2024 9
Even if the enable output ENO of the last instruction in the last network within a
program block has the signal state "0", the block ENO is not influenced.
After the NO contact "TagEnable", the enable input EN contains the result of the preceding logic
operation:
If the operand "TagEnable" has the signal state "0", the "Add" instruction is not executed.
The enable output ENO is set to signal state "0" and the called program block is exited. The
enable output ENO of the calling program block then also has the signal state "0".
If the operand "TagEnable" has the signal state "1", the enable input "EN has the signal state
"1" and the instruction "Add" is executed. The instruction adds two values of the data type
INT. If the expected result is outside the value range of INT (16 bits: -32768 to +32767), the
instruction still returns a result but it is within the value range of INT. The reason for this is
that the 16th bit for INT is the sign bit. This result does not indicate that there was an
overflow. Which is why the following applies in case of an addition => ENO:= NOT(OV). If an
error occurs during processing of the program block, the enable output ENO is set to signal
state "0" and the called program block is exited. The enable output ENO of the calling
If the operand "TagEnable" has the signal state "1", the enable input "EN has the signal state
"1" and the instruction "Add" is executed. If the instruction is executed without errors, the
enable output ENO also has the signal state "1" and the output "TagResult" the result.
A detailed description of the instruction "RET: Return" is available here: --(RET): Return
10 Manual, 11/2024
If you have activated the ENO enable output, for example with the SUB instruction, all
subsequent instructions are also applied with an activated ENO enable output. If an arithmetic
error occurs during the execution of the SUB instruction, the ADD instruction is not executed.
The ENO enable output is disabled for the DIV instruction in the second branch. If a runtime
error occurs during execution, the MUL instruction is executed anyway.
The program block is executed only if the operand "TagEnable" has the signal state "1":
The enable output ENO has a signal state that depends on what was programmed within the
program block.
If the operand "TagEnable" has the signal state "0", the program block call is not executed.
The enable input EN and the enable output ENO both have the signal state "0".
See also
Basics of the EN/ENO mechanism
To increase the performance, the EN/ENO mechanism is disabled by default for the instructions.
It can be enabled at any time also for individual instructions. For additional information on the
enabling and disabling of the EN/ENO mechanism, refer to: Enabling and disabling the EN/ENO
mechanism in LAD and FBD
For LAD/FBD program block the EN/ENO mechanism only works with an activated enable output
ENO at the respective instructions.
Manual, 11/2024 11
EN/ENO mechanism within an instruction.
You can use the enable input EN to make the execution of the instruction dependent on
conditions. The instruction is only executed if the signal state at the enable input EN is "1".
You can use the enable output ENO to query runtime errors in an instruction and react to these:
The enable output ENO has the signal state "1" if no error occurred during the execution.
Enable output ENO has the signal state "0" if one of the following conditions applies:
The enable output ENO returns the signal state "1" when the program block is processed.
If, in the case of error, you do not explicitly set the enable output ENO within the called
program block to the signal state "0", it retains the signal state "1". Using the instruction
"RET: Return" you can set the block ENO to the signal state "0".
Additional information on using the RET instruction is available here: Influencing the block
ENO of an LAD/FBD program block
1.3.2 Enabling and disabling the EN/ENO mechanism in LAD and FBD
In LAD and FBD, certain instructions have an enable output ENO and thus use the EN/ENO
mechanism. This allows you to query runtime errors in instructions and react to them. In order
to increase the performance of the CPU, the EN/ENO mechanism is disabled in the default
setting. This means that you are not initially able to react to runtime errors of the instruction
using the ENO value. However, you can enable the EN/ENO mechanism again at any time, if
required.
You can enable the EN/ENO mechanism individually for each instruction in order to generate the
ENO. If you enable the EN/ENO mechanism for an instruction, other instructions that you
subsequently add to your program are also inserted with the EN/ENO mechanism enabled. You
can disable the EN/ENO mechanism again at any time if you do not want to use the evaluation
of ENO for an instruction. Further instructions that you subsequently add to your program will
then be inserted without the EN/ENO mechanism.
Runtime errors do not cause the CPU to go to STOP when the enable output ENO is enabled.
12 Manual, 11/2024
Activating the EN/ENO mechanism
Proceed as follows to activate the EN/ENO mechanism of an instruction:
1. In your program, right-click the instruction at which you want to activate the EN/ENO
mechanism.
The ENO value is again generated for the instruction. Additional instructions are then also
1. In your program, right-click the instruction at which you want to deactivate the EN/ENO
mechanism.
2. Select the "Do not generate ENO" command from the shortcut menu.
The ENO value is no longer generated for the instruction. Additional instructions are then
See also
Basics of the EN/ENO mechanism
Description
Using the instruction "RET: Return" you jump out from a program block and hereby influence the
signal state of the ENO block.
Procedure
To influence the signal state of the block ENO, follow these steps:
1. Enable the EN/ENO mechanism of an instruction (for example, the addition "ADD").
2. Then use a negation to program the instruction "RET: Return" with signal state FALSE at the
Result
In case of error (for example, an overflow in the result), the signal state "0" is first returned at the
enable output ENO. This signal state "0" becomes signal state "1" using the negation and thus
forms the RLO = 1 for executing the instruction "RET", which returns the value FALSE. The block
ENO of the program block is hereby FALSE and a return takes place from the program block to
Manual, 11/2024 13
the next instruction after the previous program block call. This procedure can be programmed in
each network (for example, with multiple mathematical functions etc.).
However, it is not compulsory to program a jump out of the program block. Within a network
you can also use the signal state "0" of the enable output ENO of a single instruction to
determine that the subsequent instruction is not executed. The block ENO is not hereby
influenced.
Note
Influencing of the block ENO
You can only influence the signal state of the block ENO by jumping out of the
program block.
Even if the enable output ENO of the last instruction in the last network within a
program block has the signal state "0", the block ENO is not influenced.
After the NO contact "TagEnable", the enable input EN contains the result of the preceding logic
operation:
If the operand "TagEnable" has the signal state "0", the "Add" instruction is not executed.
The enable output ENO is set to signal state "0" and the called program block is exited. The
enable output ENO of the calling program block then also has the signal state "0".
If the operand "TagEnable" has the signal state "1", the enable input "EN has the signal state
"1" and the instruction "Add" is executed. The instruction adds two values of the data type
INT. If the expected result is outside the value range of INT (16 bits: -32768 to +32767), the
instruction still returns a result but it is within the value range of INT. The reason for this is
that the 16th bit for INT is the sign bit. This result does not indicate that there was an
overflow. Which is why the following applies in case of an addition => ENO:= NOT(OV). If an
error occurs during processing of the program block, the enable output ENO is set to signal
state "0" and the called program block is exited. The enable output ENO of the calling
program block then also has the signal state "0".
14 Manual, 11/2024
If the operand "TagEnable" has the signal state "1", the enable input "EN has the signal state
"1" and the instruction "Add" is executed. If the instruction is executed without errors, the
enable output ENO also has the signal state "1" and the output "TagResult" the result.
A detailed description of the instruction "RET: Return" is available here: RET: Return
If you have activated the ENO enable output, for example with the SUB instruction, all
subsequent instructions are also applied with an activated ENO enable output. If an arithmetic
error occurs during the execution of the SUB instruction, the ADD instruction is not executed.
The enable output ENO is disabled for the instruction DIV. If a runtime error occurs during
execution, the MUL instruction is executed anyway.
The program block is executed only if the operand "TagEnable" has the signal state "1":
Manual, 11/2024 15
The enable output ENO has a signal state that depends on what was programmed within the
program block.
If the operand "TagEnable" has the signal state "0", the program block call is not executed.
The enable input EN and the enable output ENO both have the signal state "0".
See also
Basics of the EN/ENO mechanism
16 Manual, 11/2024
For additional information on the BR bit, refer to: Evaluating errors with output parameter
RET_VAL
STL Description
+I // Add values
Manual, 11/2024 17
= // Assign signal state of the RLO to the
"Tag_Output" "Tag_Output" operand.
The query of the operand "TagEnable" provides the result of the preceding logic operation (RLO).
The instruction "JNB: Jump if RLO = 0 and save RLO" saves the RLO in the BR bit. Additionally, the
instruction evaluates the RLO and executes the following actions depending on the signal state:
If the RLO is "0", the processing of the program is continued at the jump label "MyLABEL"
with the query of the BR bit. The addition is not executed. The current RLO is assigned with
If the RLO is "1", the addition is executed. A query of the overflow bit (OV) shows whether an
error occurred during the addition. The query result is saved in the BR. The instruction "CLR:
Reset RLO to 0" resets the RLO to "0" and ends the logic sequence. The BR bit is then
queried and assigned to the operand "Tag_Output". The signal state of the BR bit, and the
operand "Tag_Output" shows whether the addition was executed without any error.
STL Description
18 Manual, 11/2024
operand.
See also
Basics of the EN/ENO mechanism
In SCL networks, you can influence the ENO by assigning a value. To do so, write "ENO:=TRUE" or
"ENO:=FALSE" or use a tag of the data type BOOL. When you activate the block property "Set
ENO automatically", the compiler adds program code to calculate the ENO like in the
programming languages LAD and FBD. This additional program code increases the runtime
which is why the property "Set ENO automatically" is disabled by default.
You can find additional information under: "Enabling and disabling the property "Set ENO
automatically" in SCL"
In SCL networks, you cannot assign a value to the EN parameter of an FC. This can be remedied
by calling the FC conditionally, which means placing it in an "IF" instruction. This means the
block call is not executed and does not influence the ENO. This behavior is different than the
behavior in the programming languages LAD and FBD.
You can find additional information under: "Influencing ENO of an SCL block"
Using ENO
Use of the ENO is optional for instructions.
Additional information is available here: Using enable output ENO with SCL instructions
See also
Enabling and disabling the property "Set ENO automatically" in SCL
Influencing ENO within a block
Influencing "ENO" of an SCL block
1.5.2 Enabling and disabling the property 'Set ENO automatically' in SCL
Description
When the property "Set ENO automatically" is set to "TRUE", the value of the ENO of the called
block is forwarded to the ENO of the calling block.
Manual, 11/2024 19
4. Click the "Attributes" group in the area navigation.
Result: The property "Set ENO automatically" is only enabled for the selected block.
Setting the property "Set ENO automatically" to "TRUE" for all new program
blocks
You enable the property "Set ENO automatically" in the program properties as follows:
Result: The property "Set ENO automatically" is enabled for all new program blocks.
Description
With each SCL instruction, such as a mathematical function, you must query the enable output
ENO in order to be able to work with it.
Procedure
To query the enable output ENO, proceed as follows:
2. After the SCL instruction, query the enable output ENO (for example, #MyOutputBool :=
ENO;)
If the error case occurs, for example an overflow in the result, returns the enable output ENO
returns the signal state "0". With this signal state you can continue to work and, for example,
3. Reset the signal state of the enable output ENO to "1" (for example, ENO :=1;) before
The signal state for the next error case can hereby be reset to "0". If you do not do this, the
Note
20 Manual, 11/2024
Jump to an SCL block.
With a jump to an SCL block, the signal state of the enable output ENO is
automatically set to "1".
Description
The last assignment of an ENO within an SCL program block is the ENO of the block. You can
also exit the program block and assign the value "TRUE" or "FALSE" to the ENO of the block at the
same time by using the "RETURN" instruction.
Procedure
You influence the signal state of the ENO of the block as follows:
2. Then program:
IF #n := 0 THEN
RETURN FALSE;
END_IF;
Result
When the local tag "#n" is "0", the system returns to the calling block. The ENO of the block has
the value "FALSE" in this case.
However, it is not mandatory to program a RETURN. The SCL compiler forwards the value of the
current ENO to the ENO of the block. This means the last executed assignment of the ENO will
come from the ENO of the block.
The ENO value can be influenced by the assignment "ENO:=TRUE" or "ENO:=FALSE" or a tag of
the data type BOOL. When you activate the block property "Set ENO automatically" (TRUE), the
ENO is also influenced when calling a block or an instruction.
IF #Divisor = 0 THEN
Manual, 11/2024 21
ENO:=false;
RETURN;
END_IF;
#Quotient:=Dividend/Divisor;
RETURN;
END_IF;
The program block (A) is called and processed. The called program block (B) reflects the value of
its ENO in the process. The value of the ENO of the called block (B) is copied to the ENO of the
calling block (A). This ENO is subsequently used in an "IF" instruction.
When the called block (B) returns the signal state "ENO=FALSE", the calling block (A) does not
continue with processing and also returns the signal state "ENO=FALSE".
See also
Basics of the EN/ENO mechanism
22 Manual, 11/2024
The enable output ENO has the signal state "1", as soon as the called program block has
been executed error-free.
The enable output ENO has the signal state "0" if an error occurred during the execution of
the called program block.
The enable output ENO is not influenced by the ENO of the instructions.
Description
The status of the enable output ENO is displayed during testing with program status. This has
the value TRUE if the action was successful and FALSE if the action failed.
The display option of the status of the enable output ENO is available at the following positions
in the GRAPH program block:
Permanent pre-instructions
Permanent post-instructions
Result: The EN/ENO mechanism is activated only for the selected GRAPH block.
Manual, 11/2024 23
If an error occurs during the execution, the enable output ENO has the signal state FALSE.
The program block is executed only if the operand "TagEnable" has the signal state "1":
If the operand "TagEnable" has the signal state "0", the called program block call is not
executed. Both the enable input EN and the enable output ENO have the signal state "0".
If the operand "TagEnable" has the signal state "1", the enable input "EN has the signal state
"1" and the called program block is executed. The enable output ENO has a signal state that
See also
Basics of the EN/ENO mechanism
Description
You can also use the EN/ENO mechanism in blocks with different network languages. Each
programming language displays the error status differently:
SCL has an ENO tag that stores the error status and can be queried. Direct access to this tag
LAD/FBD/STL have no special tag for ENO. However, you can read the error status for STL
from the BR bit, and query it via the RET coil for LAD/FBD.
The following rules apply to reading out the error status for the entire block:
24 Manual, 11/2024
The last network in the block is a LAD/FBD network:
If you do not use RET coils, the error status is TRUE by default.
The BR bit determines the error status. The BR bit can be edited in STL networks using the
BR tab.
Manual, 11/2024 25