0% found this document useful (0 votes)
54 views25 pages

EN-ENO Mechanism

The document is a manual detailing the EN/ENO mechanism used in Siemens programming, emphasizing safety notices, qualified personnel requirements, and proper usage of Siemens products. It explains how the EN/ENO mechanism functions across different programming languages (LAD, FBD, STL, SCL, GRAPH) and provides guidelines on enabling and disabling this mechanism for error handling in program blocks. Additionally, it includes legal information, trademarks, and a disclaimer of liability regarding the content's accuracy and consistency.

Uploaded by

Uhule Peter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views25 pages

EN-ENO Mechanism

The document is a manual detailing the EN/ENO mechanism used in Siemens programming, emphasizing safety notices, qualified personnel requirements, and proper usage of Siemens products. It explains how the EN/ENO mechanism functions across different programming languages (LAD, FBD, STL, SCL, GRAPH) and provides guidelines on enabling and disabling this mechanism for error handling in program blocks. Additionally, it includes legal information, trademarks, and a disclaimer of liability regarding the content's accuracy and consistency.

Uploaded by

Uhule Peter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

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

The product/system described in this documentation may be operated only by personnel


qualified for the specific task in accordance with the relevant documentation, in particular its
warning notices and safety instructions. Qualified personnel are those who, based on their
training and experience, are capable of identifying risks and avoiding potential hazards when
working with these products/systems.

Proper use of Siemens products

Note the following:

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

All names identified by ® are registered trademarks of Siemens Aktiengesellschaft. The


remaining trademarks in this publication may be trademarks whose use by third parties for their
own purposes could violate the rights of the owner.

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

1.1 Basics of the EN/ENO mechanism


1
Introduction
You can detect and handle certain runtime errors using the enable output ENO. Execution of
subsequent instructions depends on the signal state of the enable output. You can avoid
program crashes by using the EN/ENO mechanism. The block status is passed on in the form of a
Boolean tag.
The EN/ENO mechanism can be used at two levels:

For individual instructions (instruction ENO)

For program block calls (block ENO)

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:

RLO: RLO = 1 is applied, i.e. the block ENO is set to TRUE.

TRUE: The block ENO is set to TRUE.

FALSE: The block ENO is set to FALSE.

Operand: The signal state of the specified operand determines the block ENO.

Programming and I/O access errors


You cannot evaluate programming and I/O access errors with the EN/ENO mechanism. To do
this, use either the global error handling via OBs or the local error handling using the
"GET_ERROR" or "GET_ERR_ID" instructions (S7-1200/1500 only). If none of the errors occurred
for an instruction, you can evaluate the associated enable output ENO.

Program block calls in all programming languages (S7-300/400)


The following applies to a CPU of the S7-300/400 series: When you call program blocks that do
not include any instructions, neither the BR bit nor the ENO enable output are influenced. The
signal state of the BR bit remains constant as a result. No statement can be made about the
success of the program block call.

1.2 EN/ENO mechanism in LAD

1.2.1 Overview of the EN/ENO mechanism in LAD

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.

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:

- Enable input EN has the signal state "0".

Manual, 11/2024 7
- An error occurred during processing.

EN/ENO mechanism with program block calls


All program block calls are provided with an enable input EN and an enable output ENO. This
applies to all calling program blocks, regardless of the programming language in which they
were created. This means that when you call an STL or SCL program block in which there is no
default and pre-configured EN/ENO mechanism, the LAD or FBD program block call still has an
EN/ENO mechanism.
You can use the enable input EN to call a program block depending on conditions. The program
block is only executed if the signal state at the enable input EN is "1".
You can query the error status of the program block using the enable output ENO:

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.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.

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.

2. Select the "Generate ENO" command from the shortcut menu.

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

also inserted without the activated enable output.

See also
Basics of the EN/ENO mechanism

1.2.3 Influencing the block ENO of an LAD/FBD program block

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

enable output ENO.

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.

1.2.4 Example of the use of the EN/ENO mechanism in LAD

Example of an instruction with EN/ENO mechanism


The following example shows the "Add" instruction with EN/ENO circuit and a RET coil (Ret
False):

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".

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

Example of the effect of the enable output ENO


The following example shows you how to use instructions with the ENO enable output enabled
and disabled:

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.

Example of a program block call with EN/ENO mechanism


The following example shows the call of the program block with EN/ENO circuit:

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

1.3 EN-/ENO mechanism in FBD


1.3.1 Overview of the EN/ENO mechanism in FBD

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:

- Enable input EN has the signal state "0".

- An error occurred during processing.

EN/ENO mechanism with program block calls


All program block calls are provided with an enable input EN and an enable output ENO. This
applies to all calling program blocks, regardless of the programming language in which they
were created. This means that when you call an STL or SCL program block in which there is no
default and pre-configured EN/ENO mechanism, the LAD or FBD program block call still has an
EN/ENO mechanism.
You can use the enable input EN to call a program block depending on conditions. The program
block is only executed if the signal state at the enable input EN is "1".
You can query the error status of the program block using the enable output ENO:

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.

2. Select the "Generate ENO" command from the shortcut menu.

The ENO value is again generated for the instruction. Additional instructions are then also

inserted with the activated enable output.

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

also inserted without the activated enable output.

See also
Basics of the EN/ENO mechanism

1.3.3 Influencing the block ENO of an LAD/FBD program block

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

enable output ENO.

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.

1.3.4 Example of the use of the EN/ENO mechanism in FBD

Example of an instruction with EN/ENO mechanism


The following example shows the "Add" instruction with EN/ENO circuit and a RET coil (Ret
False):

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

Example of the effect of the enable output ENO


The following example shows you how to use instructions with the ENO enable output enabled
and disabled:

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.

Example of a program block call with EN/ENO mechanism


The following example shows the call of the program block with EN/ENO circuit:

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

1.4 EN/ENO mechanism in STL (S7-1500)


1.4.1 Overview of the EN/ENO mechanism in STL (S7-1500)

EN/ENO mechanism within an instruction.


The EN/ENO mechanism is not available for individual instructions. It is mapped by language-
specific instruction sequences and use of the status word (BR bit).
For additional information on the status word, refer to: Status word for S7-1500
Additional information is available here: Example of the simulation of the EN/ENO mechanism in
STL

EN/ENO mechanism with program block calls


A program block that you call from an STL program block is not provided with the EN and ENO
parameters. Regardless of the programming language in which the program block was created,
you can get an error statement to the calling STL program block by using the BR bit of the status
word.
You can evaluate the error status of the called program block by linking the BR bit of the status
word with the result of logic operation (RLO). The RLO has the signal state "1" as soon as the
program block execution of the called program block starts. If you do not explicitly reset the RLO
to "0" after the execution of the actions, it retains the signal state "1". To signal an error
statement back to the calling program block, you have to explicitly reset the RLO to the signal
state "0". The error statement is set with the instructions "SAVE: Save RLO in BR bit" and "JNB:
Jump if RLO = 0 and save RLO".
An error analysis of the BR bit is available in STL. The BR bit is the basis for generating the enable
output ENO in the programming languages LAD, FBD and SCL.
The value "0" in the BR bit of the status word indicates that an error occurred during an STL
program block call (calling program block is an STL program block).

CPU execution of BR bit Return value Sign of the integer


the instruction

With error(s) 0 Less than "0" Negative (sign bit is "1")

Without error 1 Greater than or equal Positive (sign bit is "0")


to "0"

16 Manual, 11/2024
For additional information on the BR bit, refer to: Evaluating errors with output parameter
RET_VAL

1.4.2 Example of the simulation of the EN/ENO mechanism in STL (S7-1500)

Example of a program sequence with EN/ENO mechanism


The following example shows a program section for adding values with EN/ENO mechanism:

STL Description

A "TagEnable" // Query the signal state of


the "TagEnable" operand for
"1" and AND with the current
RLO.

JNB MyLABEL // Evaluation of the enable


input EN
// If RLO = "0", jump to jump
label "MyLABEL" and save the
current RLO in the BR bit. The
following actions are not
executed.
// If the RLO = "1", execute
the following actions.

L "Tag_Input_1" // Load first value for


addition.

L "Tag_Input_2" // Load second value for


addition.

+I // Add values

T "Tag_Result" // Transfer sum to the operand


"Tag_Result".​

AN OV // Query whether an overflow


has occurred.

SAVE // Transfer signal state of


the RLO to the BR bit.

CLR /// Reset RLO to "0" and end


logic sequence.

MyLABEL: A BR // Jump label "MyLABEL"


// Query BR bit.

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

the operand "Tag_Output".

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.

Example of a program block call with EN/ENO mechanism


The following example shows the call of the program block with EN/ENO circuit:

STL Description

A "TagEnable" // Query the signal state of


the "TagEnable" operand for
"1" and AND with the current
RLO.

JNB MyLABEL // Evaluation of the enable


input EN
// If RLO = "0", jump to jump
label "MyLABEL" and save the
current RLO in the BR bit. The
following actions are not
executed.
// If the RLO = "1", execute
the following actions.

CALL "Block name", "Block // The program block is


name_DB" called.

MyLABEL: A BR // Jump label "MyLABEL"


// Query BR bit and link with
the RLO after AND.

= "Tag_Output" // Assign signal state of the


RLO to the "Tag_Output"

18 Manual, 11/2024
operand.

See also
Basics of the EN/ENO mechanism

1.5 EN/ENO mechanism in SCL

1.5.1 Overview of the EN/ENO mechanism in SCL

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.

Enabling ENO mechanism in the block properties


You enable the property "Set ENO automatically" in the block properties as follows:

1. Open the "Program blocks" folder in the project navigator.

2. Right-click the SCL block whose properties you want to display.

3. Select the "Properties" command in the shortcut menu.

The properties dialog box of the block opens.

Manual, 11/2024 19
4. Click the "Attributes" group in the area navigation.

5. Activate the property "Set ENO automatically".

6. Confirm your entries with "OK".

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:

1. Select the "Settings" command in the "Options" menu.

The "Settings" window is displayed in the working area.

2. In the area navigation, select the "PLC programming" group.

3. Select the group "SCL (Structured Control Language)".

4. Activate the property "Set ENO automatically".

Result: The property "Set ENO automatically" is enabled for all new program blocks.

1.5.3 Using enable output ENO with SCL instructions

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:

1. Activate the EN/ENO mechanism.

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,

program the instruction "RETURN", a fault display or a substitute value.

3. Reset the signal state of the enable output ENO to "1" (for example, ENO :=1;) before

processing the next instruction.

The signal state for the next error case can hereby be reset to "0". If you do not do this, the

signal state of the enable output ENO remains "0".

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".

1.5.4 Influencing 'ENO' of an SCL block

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:

1. Activate the ENO mechanism.

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.

1.5.5 Influencing ENO within a 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.

1.5.6 Example for using ENO in SCL

Setting example for ENO


The following example shows an SCL block which checks prior to a division whether the divisor
is 0. In this case, ENO is set to the value "FALSE" and the subsequent division is not performed. A
calling block can evaluate the ENO of the called block and decide whether the program is to be
continued or not.

IF #Divisor = 0 THEN

Manual, 11/2024 21
ENO:=false;

RETURN;

END_IF;

#Quotient:=Dividend/Divisor;

Example for calling a program block with ENO mechanism


The following example shows the call of a program block (A) which handles the ENO of a called
block (B).

"BlockName_DB"( ENO => ENO );

IF ENO = false THEN

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

1.6 EN/ENO mechanism in GRAPH (S7-1500)


1.6.1 Overview of the EN/ENO mechanism in GRAPH (S7-1500)

EN/ENO mechanism within an instruction.


You have no access to the enable output ENO of the instructions, which means you cannot
influence the status of the enable output ENO at the GRAPH function block. However, with
conversions, mathematical functions or LAD/FBD instructions, for example, you can have the
enable output ENO displayed in the program status.

EN/ENO mechanism with program block calls


You can use the enable input EN to call a program block depending on conditions. The program
block is only executed if the signal state at the enable input EN is "1".
You can query the error status of the program block using the enable output ENO:

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 cannot be explicitly set or reset.

The enable output ENO is not influenced by the ENO of the instructions.

1.6.2 Activating and deactivating EN/ENO mechanism in GRAPH (S7-1500)

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

Sequence view > Actions

Permanent post-instructions​

Enabling EN/ENO mechanism in the block properties


Proceed as follows to activate the EN/ENO mechanism in the block properties:

1. Open the "Program blocks" folder in the project navigator.

2. Right-click the GRAPH block whose properties you want to display.

3. Select the "Properties" command in the shortcut menu.

The properties dialog box of the block opens.

4. Click the "Attributes" group in the area navigation.

5. Activate the property "Set ENO automatically".

6. Confirm your entries with "OK".

Result: The EN/ENO mechanism is activated only for the selected GRAPH block.

1.6.3 Example of the EN/ENO mechanism in GRAPH (S7-1500)

Example of a program status with enable output ENO


The following example shows the program status of the enable output ENO in the sequence
view under actions:

Manual, 11/2024 23
If an error occurs during the execution, the enable output ENO has the signal state FALSE.

Example of a program block call


The following example shows the call of the GRAPH program block in a LAD program block with
EN/ENO connected:

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

depends on what was programmed within the program block.

See also
Basics of the EN/ENO mechanism

1.7 EN/ENO mechanism in blocks with different network languages (S7-


1200, S7-1500)

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

is only possible with SCL.

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 last network in the block is an STL network:

The BR bit determines the error status. The BR bit can be edited in STL networks using the
BR tab.

The last network in the block is an SCL network:

The ENO tag determines the error status of the block.

Influencing of the block ENO


For LAD/FBD program blocks with multiple networks that could consist of different programming
languages (such as LAD, FBD, STL or SCL), the last processed network determines the signal
state of the block ENO.
If the last processed network of such a program block is a LAD or FBD network, the signal state
of the block ENO is not necessarily influenced. With an instruction in which the EN/ENO
mechanism is activated, it is only influenced if the enable output ENO has the signal state "0"
and it is possible to return for the program block using the instruction "RET: Return". If this
instruction was not programmed, the block ENO always has the signal state "1". The signal state
"0", if any, of an instruction ENO has no influence on the block ENO, as the signal state "1" is
always set at the start of a network.
This applies also to a LAD or FBD network that is before another network (LAD, FBD or SCL). The
signal state of the block ENO is influenced only using the instruction "RET: Return". Otherwise,
the signal state of the block ENO is reset to "1" at the transition to the network.
If the last network of a mixed program block is an SCL network, the block ENO is always
influenced by this.
See also
Basics of the EN/ENO mechanism

Manual, 11/2024 25

You might also like