Technical data

Table Of Contents
IEC Functions
System Software for S7-300/400 System and Standard Functions - Volume 2/2
26-18
A5E00739858-01
26.9 Example in STL
CALL FC 27
IN1 := P#M 10.0 DINT 1
IN2 := MD20
IN3 := P#DB1.DBX 0.0 DINT 1
RET_VAL := P#M 40.0 DINT 1
= M 0.0
Note:
The admitted data types INT, DINT and REAL must be entered in the ANY pointer.
Such parameters as “MD20“ are also admitted, but you must define the
corresponding data type of “MD20“ in “Symbol“.
Description FC36 SEL
The function FC36 selects one of two variable values depending on a switch
(parameter G). Variables with all data types which correspond to the data width bit,
byte, word, and double word (not data types DT and STRING) are permitted as
input values at the parameters IN0 and IN1. Both input variables and the output
variable must be of the same data type.
The output value remains unchanged and the binary result (BR) bit of the status
word is set to “0" if any of the following are true:
A variable with parameters assigned has an invalid data type
All variables with parameters assigned do not have the same data type
A REAL variable does not represent a valid floating-point number.
Parameter Declaration Data Type Memory Area Description
G INPUT BOOL I, Q, M, D, L Selection switch
IN0 INPUT ANY I, Q, M, D, L First input value
IN1 INPUT ANY I, Q, M, D, L Second input value
RET_VAL OUTPUT ANY I, Q, M, D, L Selected input value