Ret Execution Control Instruction - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

100BBasic instructions
7.8 Program control
Table 7- 113 SWITCH box data type selection and allowed comparison operations
Data type
Byte, Word, DWord
SInt, Int, DInt, USInt, UInt,
UDInt, Real, LReal, Time, TOD,
Date
SWITCH box placement rules
● No LAD/FBD instruction connection in front of the compare input is allowed.
● There is no ENO output, so only one SWITCH instruction is allowed in a network and the
7.8.14

RET execution control instruction

The optional RET instruction is used to terminate the execution of the current block. If and
only if there is power flow to the RET coil (LAD) or if the RET box input is true (FBD), then
program execution of the current block will end at that point and instructions beyond the RET
instruction will not be executed. If the current block is an OB, the "Return_Value" parameter
is ignored. If the current block is a FC or FB, the value of the "Return_Value " parameter is
passed back to the calling routine as the ENO value of the called box.
You are not required to use a RET instruction as the last instruction in a block; this is done
automatically for you. You can have multiple RET instructions within a single block.
For SCL, see the RETURN (Page 216) statement.
Table 7- 114 Return_Value (RET) execution control instruction
LAD
FBD
Table 7- 115 Data types for the parameters
Parameter
Data type
Return_Value
Bool
220
SWITCH instruction must be the last operation in a network.
SCL
RETURN;
Description
The "Return_value" parameter of the RET instruction is assigned to the ENO output
of the block call box in the calling block.
Comparison
Equal
Not equal
Equal
Not equal
Greater than or equal
Less than or equal
Greater than
Less than
Description
Terminates the execution of the current block
Operator syntax
==
<>
==
<>
>=
<=
>
<
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents