
394
7 APPLICATION INSTRUCTION
7.6 Character string operation instruction
Storing the specified number of character strings
MIDR(P)
These instructions extract the number of characters specified by (s2)+1 of the character string data stored in the device
specified by (s1) and later from the position specified by (s2), and store the extracted characters in the device specified by (d)
and later.
Setting data
■
Descriptions, ranges, and data types
■
Applicable devices
*1
T, ST, C cannot be used.
Processing details
• These instructions extract the number of characters specified by (s2)+1 of the character string data stored in the device
specified by (s1) and later from the position specified by (s2), and store the extracted characters in the device specified by
(d) and later.
• A character string stored in (s1) indicates data stored in devices from the specified device until "00H" is first detected in
units of byte.
• A NULL code (00H), which indicates an end of a character string, is automatically added at the end of the character string
data.
• When the number of extracted characters "(s2)+1" is odd, "00H" is stored in the upper byte of a device storing the last
character. When the number of extracted characters "(s2)+1" is even, "0000H" is stored in the device after the last
character.
• If the number of characters specified by (s2)+1 is 0, no processing is performed.
Ladder diagram
Structured text
ENO:=MIDR(EN,s1,s2,d);
ENO:=MIDRP(EN,s1,s2,d);
Operand
Description
Range
Data type
Data type (label)
(s1)
Character string or head device number storing a character string
Character string
Character string
(d)
Head device number for storing the character string data of the
operation result
Character string
Character string
(s2)
Head device number for storing the number of characters and position
of the start character
(s2)+0: Position of the start character, (s2)+1: Number of characters
16-bit signed binary
ANY16
Operand
Bit
Word
Double word
Indirect
specification
Constant
Others
X, Y, M, L,
SM, F, B, SB
U
\G
T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U
\G
Z
LC
LZ
K, H
E
$
(s1)
(d)
(s2)
(s1)
(d)
(s2)
41H (A)
42H (B)
43H (C)
44H (D)
45H (E)
46H (F)
47H (G)
48H (H)
45H (E)
46H (F)
47H (G)
48H (H)
49H (I)
4AH (J)
4BH (K)
00H
49H (I)
00H
"ABCDEFGHIJK"
"EFGHI"
b15
b0
b7
b8
b15
b0
b7
b8
(s1)
(s1)+1
(s1)+2
(s1)+3
(s1)+4
(s1)+5
(d)
(d)+1
(d)+2
5
5
(s2)
(s2)+1
ASCII code for 5th character (s2)+1
5th character position
(s2)
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: ......