Download Print this page

Extract Mid String - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

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

Advertisement

25.3

Extract Mid String

MID(_E)
These functions output the specified number of characters from an arbitrary position of an input character string.
Ladder diagram, FBD/LD
[Without EN/ENO]
s
d
n1
n2
Setting data
■Descriptions, types, and data types
Argument
Description
EN
Execution condition (TRUE: Execution, FALSE: Stop)
s(IN)
Input
n1(L)
Specification of number of characters to be extracted
n2(P)
Specification of head character position of a character string to be
extracted
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d(MID(_E))
Output
Processing details
■Operation processing
• These functions output the data for the specified number of characters from an arbitrary position of a character string input
to (s).
• The value input to (n1) specifies the number of characters to be extracted.
• The value input to (n2) specifies the number of the head character position of a character string to be extracted.
Ex.
When the value input to (n1) and (n2) is 5
(s)
"ABCDEF12345"
High-order byte Low-order byte
+0
42H (B)
41H (A)
44H (D)
43H (C)
+1
+2
46H (F)
45H (E)
+3
32H (2)
31H (1)
+4
34H (4)
33H (3)
+5
00H
35H (5)
(1): Head character position of a character string to be extracted n2: 5th character
(2): Number of characters to be extracted n1: 5
• A value input to (s) is the STRING type data value and within the range from 0 to 255 byte(s).
• A value input to (n1) is the INT type data value and within the range from 0 to 255. (However, the value must be within the
number of characters of the character string to be input to (s).)
• A value input to (n2) is the INT type data value and within the range from 1 to 255. (However, the value must be within the
number of characters of the character string to be input to (s).)
[With EN/ENO]
EN
ENO
s
d
n1
n2
(d)
"EF123"
High-order byte Low-order byte
46H (F)
32H (2)
(1)
00H
(2)
Structured text
[Without EN/ENO]
d:=MID(s,n1,n2);
[With EN/ENO]
d:=MID_E(EN,ENO,s,n1,n2);
Type
Input variable
Input variable
Input variable
Input variable
Output variable
Output variable
45H (E)
+0
31H (1)
+1
33H (3)
+2
25 CHARACTER STRING FUNCTIONS
Data type
BOOL
STRING(255)
INT
INT
BOOL
STRING(255)
1027
25.3 Extract Mid String
25

Hide quick links:

Advertisement

loading