EasyManua.ls Logo

Siemens S7-1200 - RET (Return) Instruction

Siemens S7-1200
1028 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Basic instructions
7.8 Program control operations
S7-1200 Programmable controller
258 System Manual, 03/2014, A5E02486680-AG
Table 7- 98 SWITCH box data type selection and allowed comparison operations
Data type
Comparison
Operator syntax
Byte, Word, DWord
Equal
==
Not equal
<>
SInt, Int, DInt, USInt, UInt,
UDInt, Real, LReal, Time, TOD,
Date
Equal
==
Not equal
<>
Greater than or equal
>=
Less than or equal
<=
Greater than
>
Less than
<
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
SWITCH instruction must be the last operation in a network.
7.8.4
RET (Return) 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 274) statement.
Table 7- 99 Return_Value (RET) execution control instruction
LAD
FBD
SCL
Description
RETURN;
Terminates the execution of the current block
Table 7- 100 Data types for the parameters
Parameter
Data type
Description
Return_Value Bool The "Return_value" parameter of the RET instruction is assigned to the ENO output
of the block call box in the calling block.

Table of Contents

Other manuals for Siemens S7-1200

Related product manuals