100BBasic instructions
7.8 Program control
S7-1200 Programmable controller
220
System Manual, 11/2011, A5E02486680-05
Table 7- 113 SWITCH box data type selection and allowed comparison operations
Data type
Comparison
Operator syntax
Equal
==
Byte, Word, DWord
Not equal
<>
Equal
==
Not equal
<>
Greater than or equal
>=
Less than or equal
<=
Greater than
>
SInt, Int, DInt, USInt, UInt,
UDInt, Real, LReal, Time, TOD,
Date
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.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
SCL
Description
RETURN;
Terminates the execution of the current block
Table 7- 115 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.