Storing The Specified Number Of Character Strings - Mitsubishi MELSEC iQ-F FX5 series Programming Manual

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

Advertisement

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.
Ladder diagram
(s1)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s1)
Character string or head device number storing a character string
(d)
Head device number for storing the character string data of the
operation result
(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
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB
(s1)
(d)
(s2)
*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.
b15
(s1)
42H (B)
(s1)+1
44H (D)
(s1)+2
46H (F)
(s1)+3
48H (H)
4AH (J)
(s1)+4
(s1)+5
00H
"ABCDEFGHIJK"
(s2)
5
(s2)+1
5
• 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.
7 APPLICATION INSTRUCTION
394
7.6 Character string operation instruction
(d)
(s2)
Word
U\G T, ST,
T, ST, C, D,
C, LC
W, SD, SW, R
*1
*1
b8
b7
b0
41H (A)
43H (C)
45H (E)
5th character position
47H (G)
(s2)
49H (I)
ASCII code for 5th character (s2)+1
4BH (K)
Structured text
ENO:=MIDR(EN,s1,s2,d);
ENO:=MIDRP(EN,s1,s2,d);
Range
Double word Indirect
U\G
Z
LC
LZ
b15
(d)
46H (F)
(d)+1
48H (H)
(d)+2
00H
"EFGHI"
Data type
Data type (label)
Character string
Character string
Character string
Character string
16-bit signed binary
ANY16
Constant
specification
K, H
E
b8
b7
b0
45H (E)
47H (G)
49H (I)
Others
$

Advertisement

Table of Contents
loading

Table of Contents