Technical data

Table Of Contents
IEC Functions
System Software for S7-300/400 System and Standard Functions - Volume 2/2
A5E00739858-01
26-21
Description FC20 LEFT
The function FC20 provides the first L characters of a string (where L stands for a
number). If L is greater than the current length of the STRING variables, the input
value is returned. With L = 0 and with a blank string as the input value, a blank
string is returned. If L is negative, a blank string is returned and the binary result
(BR) bit of the status word is set to “0".
Parameter Declaration Data Type Memory Area Description
IN INPUT STRING D, L Input variable in format STRING
L INPUT INT I, Q, M, D, L,
Const.
Length of the left character sting
RET_VAL OUTPUT STRING D, L Output variable in format
STRING
You can assign only a symbolically defined variable for the parameter IN and the
return value.
Description FC21 LEN
A STRING variable contains two lengths: the maximum length (this is given in
square brackets when the variables are being defined) and the current length (this
is the number of currently valid characters). The current length must be smaller
than or equal to the maximum length. The number of bytes occupied by a string is
2 greater than the maximum length.
The function FC21 outputs the current length of a string (number of valid
characters) as a return value. A blank string (' ') has the length zero. The maximum
length is 254. The function does not report any errors.
Parameter Declaration Data Type Memory Area Description
S INPUT STRING D, L Input variable in format STRING
RET_VAL OUTPUT INT I, Q, M, D, L Number of valid characters
You can assign only a symbolically defined variable for the input parameter.