Program instructions
7.15 String
7.15
String
7.15.1
String (Get length, copy, and concatenate)
SLEN (String length)
LAD / FBD
STL
SLEN IN, OUT
Error conditions with ENO = 0
0006H Indirect address
•
0091H Operand out of range
•
Input / output
Data type
IN
STRING
OUT
BYTE
SCPY and SCAT (String copy and string concatenate)
LAD / FBD
STL
SCPY IN, OUT
SCAT IN, OUT
Note: The STR_CPY and STR_CAT instructions operate on bytes and not characters. Because Chinese characters are not
represented by a single byte, unexpected results can occur with the STR_CPY and STR_CAT instructions with strings
containing Chinese characters. If you know the number of bytes that a character string occupies, you can use the
STR_CPY and STR_CAT instructions with the correct number of bytes.
362
Description
The string length instruction returns the length in bytes of the string specified by
IN.
Note: Because Chinese characters are not represented by a single byte, the
STR_LEN function does not return the number of characters in a string contain-
ing Chinese characters.
SM bits affected
None
Operand
VB, LB, *VD, *LD, *AC, Constant string
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC
Description
The copy string instruction copies the string assigned by IN to the string as-
signed by OUT.
The concatenate string instruction appends the string assigned by IN to the
end of the string assigned by OUT.
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART
Need help?
Do you have a question about the SIMATIC S7 and is the answer not in the manual?
Questions and answers