
22 CHARACTER STRING FUNCTIONS
22.2 Extracting Character String Data from the Left/Right
815
22
22.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
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
Input
Input variable
STRING(255)
n
Specification of number of characters to be extracted
Input variable
INT
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d
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.
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)
2nd word
3rd word
4th word
5th word
6th word
1st word
2nd word
4th word
3rd word
1st word
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"
Number of
characters to be
extracted (L): 7
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......