Mitsubishi MELSEC Q Series Programming Manual page 613

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
• The value of n exceeds the number of characters for
• 00
(NULL) does not exist within the corresponding device range after the device
H
designated by
• The value of n is negative number or "0".
Program Example
(1) The following program searches from the 5th character from the left of the character string
data stored in devices starting from R0 for the character string data in devices starting from
D0, and stores the results at D100 when X0 goes ON.
[Ladder Mode]
[Operation]
b15
R0
49
(I)
H
R1
33
(3)
H
R2
32
(2)
H
R3
49
(I)
H
R4
00
H
(2) The following program searches from the 3rd character from the left of the character string
data being stored in devices starting from D0 for the character string data "AB", and stores
the results of the search at D100 when X1C goes ON.
[Ladder Mode]
[Operation]
b15
D0
32
(2)
H
D1
34
(4)
H
D2
42
(B)
H
D3
36
(6)
H
D4
42
(B)
H
D5
,
.
S1
S2
b8b7
b0
Not searched since
43
(C)
H
the search start
32
(2)
position is 5
H
31
(1)
Searches from
H
the 5th character
43
(C)
H
4D
(M)
H
"CI2312CIM"
b8b7
b0
31
(1)
H
33
(3)
H
41
(A)
H
35
(5)
H
41
(A)
H
00
H
.
S2
[List Mode]
Step
Instruction
b15
D0
49
(I)
H
D1
33
(3)
H
D2
D100
Stores "0" because there are no matches.
[List Mode]
Step
Instruction
Searches from the
"AB"
3rd character
5th character from
the first character
INSTR(P)
(Error code: 4100)
(Error code: 4100)
(Error code: 4100)
Device
b8b7
b0
43
(C)
H
32
(2)
H
00
H
"CI23"
0
Device
D100
5
7-239
1
2
3
4
6
6
7
8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents