EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 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...
Extended instructions
9.2 String and character
S7-1200 Programmable controller
364 System Manual, V4.2, 09/2016, A5E02486680-AK
9.2.4.4
LEFT, RIGHT, and MID (Read substrings in a character string) instructions
Table 9- 55 Left, right and middle substring operations
LAD / FBD
SCL
Description
out := LEFT(in, L);
LEFT (Left substring) provides a substring made of the first L charac-
ters of string parameter IN.
If L is greater than the current length of the IN string, then the entire
IN string is returned in OUT.
If an empty string is the input, then an empty string is returned in
OUT.
out := MID(in, L, p);
MID (Middle substring) provides the middle part of a string. The middle
substring is L characters long and starts at character position P (inclu-
sive)
If the sum of L and P exceeds the current length of the string parame-
ter IN, then a substring is returned that starts at character position P
and continues to the end of the IN string.
out := RIGHT(in, L);
RIGHT (Right substring) provides the last L characters of a string.
If L is greater than the current length of the IN string, then the entire
IN string is returned in parameter OUT.
If an empty string is the input, then an empty string is returned in
OUT.
Table 9- 56 Data types for the parameters
Parameter and type
Data type
Description
IN
IN
String, WString
Input string
L IN Int Length of the substring to be created:
LEFT uses the left-most characters number of characters in the
string
RIGHT uses the right-most number of characters in the string
MID uses the number of characters starting at position P within
the string
P IN Int MID only: Position of first substring character to be copied
P= 1, for the initial character position of the IN string
OUT
OUT
String, WString
Output string

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals