Download Print this page

Extracting Character String Data From The Left/Right - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

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.
Ladder diagram, FBD/LD
[Without EN/ENO]
s
d
n
Setting data
■Descriptions, types, and data types
Argument
Description
EN
Execution condition (TRUE: Execution, FALSE: Stop)
s(IN)
Input
n(L)
Specification of number of characters to be extracted
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d(LEFT(_E) / RIGHT(_E))
Output
Processing details
■Operation processing
• LEFT(_E)
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.
Ex.
When the value input to (n) is 7
"ABCDEF12345"
High-order byte Low-order byte
+0
42H (B)
41H (A)
+1
44H (D)
43H (C)
+2
46H (F)
45H (E)
+3
32H (2)
31H (1)
34H (4)
33H (3)
+4
+5
00H
35H (5)
(1): Number of characters to be extracted (L): 7
[With EN/ENO]
EN
ENO
s
d
n
"ABCDEF1"
High-order byte Low-order byte
42H (B)
44H (D)
46H (F)
00H
(1)
Structured text
[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);
Type
Input variable
Input variable
Input variable
Output variable
Output variable
41H (A)
+0
43H (C)
+1
45H (E)
+2
31H (1)
+3
25 CHARACTER STRING FUNCTIONS

25.2 Extracting Character String Data from the Left/Right

25
Data type
BOOL
STRING(255)
INT
BOOL
STRING(255)
1025

Hide quick links:

Advertisement

loading