Chapter 6 Instruction and Flag List
XBC E-Type Main Unit
6-221
Ver. 1
6.32.16 DETECT, DETECTP
Instruction
Area Available
Step
Flag
P M K
F
L
T
C
S
Z D.x R.x
Con
st
U
N
D
R
Error
(F110)
Zero
(F111)
Carry
(F112)
DETECT(P)
S1 O O O O O O O
-
O
-
-
-
O O O O
4~6
O
O
-
S2 O O O O O O O
-
O
-
-
O O O O O
D
O O O
-
O O O
-
O
-
-
-
O O O O
N
O O O
-
O O O
-
O
-
-
O O O O O
Operand
Description
Data Type
S1
Start position of data to detect
WORD
S2
Allowance
WORD
D
1
st
changed position & the number searched
WORD
N
Range
WORD
[Flag Setting]
Flag
Description
Device Number
Error
If N exceeds applicable device’s range
F110
Zero
To be set if no data exceeds the allowance specified in searching result S2.
F111
1) DETECT
(1) Saves the position of the 1st value that is out of allowance in D. If the value is larger than allowance (S1)
among N data from S1 (signed operation, searching unavailable if identical to allowance), and the sum of the
number of the data larger than S1 in D+1.
(2) If N=0, the instruction will not be executed.
2) Program Example
(1) When D01000=h1111, D01001=h3333,D01002=h2222, D01100=h3000, D01300=h0003, if Input Signal is
P00000 is changed from Off to On status, it saves D01200=h0002, D01201=h0001.
P00000
DETECTP D01000 D01100 D01200 D01300
DETECT
means DETECT
P S1
DETECTP
S1
D
N
S2
D
N
S2
357
Data to search
S1
S1+1
S1+2
S1+(N-2)
S1+(N-1)
Searching range
(N)
Head No. of object to search
Data searched
35
70
500
356
358
-357
357
487
Number of data
searched (3)
Searching progress
D
D+1
S2
Position exceeded (3)
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...