EasyManua.ls Logo

Siemens S7-1200 - LEFT, RIGHT, and MID (Read Substrings in a Character String) Instructions

Siemens S7-1200
1028 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
8.2 String and character
S7-1200 Programmable controller
308 System Manual, 03/2014, A5E02486680-AG
Table 8- 54 ENO status
ENO
Condition
OUT
1
No errors detected
Valid characters
0 Resulting string after concatenation is larger than maximum length of OUT
string
Resulting string characters are
copied until the maximum length
of the OUT is reached
Current length of IN1 exceeds maximum length of IN1, current length of
IN2 exceeds maximum length of IN2, or current length of OUT exceeds
maximum length of OUT (invalid string)
Current length is set to 0
Maximum length of IN1, IN2 or OUT does not fit within allocated memory
range
Maximum length of IN1 or IN2 is 255, or the maximum length of OUT is 0
or 255
8.2.4.4
LEFT, RIGHT, and MID (Read substrings in a character string) instructions
Table 8- 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
characters 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
(inclusive).
If the sum of L and P exceeds the current length of the string
parameter 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 of Contents

Other manuals for Siemens S7-1200

Related product manuals