32 STRING FUNCTIONS
32.2 Extracting String Data From the Left/Right
1947
32
■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).
When (n)=7
• 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).
When (n)=5
• 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.
*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.
Execution condition Operation result
EN ENO (d)
TRUE (executed) TRUE Operation result output value
FALSE (not executed) FALSE
*1
Undefined value
(s)
(d)
ABCDEF1ABCDEF12345
45H(E)46H(F)
33H(1)00H
43H(C)44H(D)
41H(A)42H(B)
35H(5)00H
33H(3)34H(4)
31H(1)32H(2)
45H(E)46H(F)
43H(C)44H(D)
41H(A)42H(B) +0
+2
+3
+1
+0
+5
+4
+3
+2
+1
Lower byteUpper byteLower byteUpper byte
Number of characters
to be extracted (n): 7
(s)
(d)
12345ABCDEF12345
35H(5)00H
33H(3)34H(4)
31H(1)32H(2)
35H(5)00H
33H(3)34H(4)
31H(1)32H(2)
45H(E)46H(F)
43H(C)44H(D)
41H(A)42H(B) +0
+2
+1
+0
+5
+4
+3
+2
+1
Lower byteUpper byteLower byteUpper byte
Number of characters
to be extracted (n): 5