Standard Character String Functions; Extract Mid String - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

5.7

Standard Character String Functions

Extract mid string

MID(_E)
High
Basic
Process
performance
Structured ladder/FBD
MID_E
EN
ENO
s
n1
n2
The following function(s) can go in the dotted squares.
MID, MID_E
■Argument
Input/output
argument
Input argument
Output argument
Processing details
■Operation processing
• Extracts the specified number of characters from the specified start position in the character string input to (s), and outputs
the operation result from (d). The number of characters to be extracted is specified by the value input to n1. The start
position of the characters to be extracted is specified by the value input to n2.
Ex.
Values input to n1 and n2 are 5
'ABCDEF12345'
High-order byte Low-order byte
1st word
42
(B)
H
2nd word
44
(D)
H
3rd word
46
(F)
H
4th word
32
(2)
H
5th word
34
(4)
H
6th word
00
H
• The value to be input to (s) is string type data within the range from 0 to 255 bytes.
• The value to be input to n1 is word (signed) type data within the range from 0 to 255. (The input value must not exceed the
number of characters of character string input to (s).)
• The value to be input to n2 is word (signed) type data within the range from 1 to 255. (The input value must not exceed the
number of characters of character string input to (s).)
5 APPLICATION FUNCTIONS
154
5.7 Standard Character String Functions
LCPU
Redundant Universal
ST
ENO:=
MID_E
d
Name
Description
EN
Executing condition (TRUE: Execution, FALSE:
Stop)
s(_IN)
Input
n1(_L)
Number of characters to be extracted
n2(_P)
Start position to be extracted
ENO
Execution result (TRUE: Normal, FALSE: Error)
d
Output
41
(A)
H
43
(C)
H
45
(E)
Start position to
H
be extracted n2:
31
(1)
H
5th character
33
(3)
H
35
(5)
H
Number of characters to be extracted n1: 5 characters
(EN, s, n1, n2, d);
'EF123'
High-order byte Low-order byte
46
(F)
45
(E)
H
H
32
(2)
31
(1)
H
H
00
33
(3)
H
H
Data type
Bit
String (255)
Word (signed)
Word (signed)
Bit
String (255)
1st word
2nd word
3rd word

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents