25 CHARACTER STRING FUNCTIONS
25.2 Extracting Character String Data from the Left/Right
1025
25
25.2
Extracting Character String Data from the Left/
Right
LEFT(_E), RIGHT(_E)
• LEFT(_E): These functions output specified number of characters from the left of input character string data.
• RIGHT(_E): These functions output specified number of characters from the right of input character string data.
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• LEFT(_E)
Ex.
When the value input to (n) is 7
Ladder diagram, FBD/LD
Structured text
[Without EN/ENO]
[With EN/ENO]
[Without EN/ENO]
d:=LEFT(s,n);
d:=RIGHT(s,n);
[With EN/ENO]
d:=LEFT_E(EN,ENO,s,n);
d:=RIGHT_E(EN,ENO,s,n);
Argument
Description
Type
Data type
EN
Execution condition (TRUE: Execution, FALSE: Stop)
Input variable
BOOL
s(IN)
Input
Input variable
STRING(255)
n(L)
Specification of number of characters to be extracted
Input variable
INT
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d(LEFT(_E) / RIGHT(_E))
Output
Output variable
STRING(255)
These functions output the data for the specified number of characters from the left of a character string input to (s) from (d).
The value input to (n) specifies the number of characters to be extracted.
(1): Number of characters to be extracted (L): 7
s
d
n
EN
ENO
s
d
n
42H (B)
41H (A)
44H (D)
43H (C)
46H (F)
45H (E)
32H (2)
31H (1)
34H (4)
33H (3)
00H
35H (5)
+1
+2
+3
+4
+5
(1)
+0
+1
+3
+2
+0
42H (B)
41H (A)
44H (D)
43H (C)
00H
46H (F)
31H (1)
45H (E)
High-order byte Low-order byte
High-order byte Low-order byte
"ABCDEF12345"
"ABCDEF1"
Summary of Contents for MELSEC iQ-F FX5
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......