Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 1949

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Processing details
■Operation processing
• LEFT(_E)
These functions extract the specified number of characters, starting from the left end of the string input to (s), and output the
operation result from (d).
Specify the number of characters to be extracted in (n).
Ex.
When (n)=7
(s)
ABCDEF12345
Upper byte
+0
42H(B)
+1
44H(D)
+2
46H(F)
+3
32H(2)
+4
34H(4)
+5
00H
• RIGHT(_E)
These functions extract the specified number of characters, starting from the right end of the string input to (s), and output the
operation result from (d).
Specify the number of characters to be extracted in (n).
Ex.
When (n)=5
(s)
ABCDEF12345
Upper byte
+0
42H(B)
+1
44H(D)
+2
46H(F)
+3
32H(2)
+4
34H(4)
+5
00H
• Input a STRING data type value to (s) within the range of 0 to 255 bytes.
• Input an INT data type value to (n) within the range of 0 to 255, provided that it is within the number of characters in the
string input to (s).
■Operation result
1.
Function without EN/ENO
The operation processing is performed. The operation result is output from (d).
2.
Function with EN/ENO
The execution conditions and operation results will be as follows.
Execution condition
EN
TRUE (executed)
FALSE (not executed)
*1 If the value FALSE is output from ENO, the output data from (d) will be undefined. Create a program so that the undefined value will not
be used in operations.
Lower byte
41H(A)
43H(C)
45H(E)
31H(1)
33H(3)
Number of characters
35H(5)
to be extracted (n): 7
Lower byte
41H(A)
43H(C)
45H(E)
31H(1)
33H(3)
Number of characters
to be extracted (n): 5
35H(5)
Operation result
ENO
TRUE
*1
FALSE
(d)
ABCDEF1
Upper byte
Lower byte
42H(B)
41H(A)
44H(D)
43H(C)
46H(F)
45H(E)
00H
33H(1)
(d)
12345
Upper byte
Lower byte
32H(2)
31H(1)
34H(4)
33H(3)
00H
35H(5)
(d)
Operation result output value
Undefined value
32 STRING FUNCTIONS
32.2 Extracting String Data From the Left/Right
+0
+1
+2
+3
32
+0
+1
+2
1947

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents