7.5 Data Processing Instructions
7.5.11 Minimum value search of 16-/32-bit data
7-89
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
M
IN, D
M
IN
MIN, DMIN
DMIN(P)
(1) Searches for the minimum value in the n points of 32-bit BIN data, from the device specified
for
, and stores searched minimum value to the devices specified for
and
+1.
Searches from the device specified for
and counted from
, stores the location of the
device number which is stored in the minimum value of the first search to
+2 and stores
the number of minimum values to
+3.
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The range of n points from the device specified for
exceeds the corresponding device.
(Error code: 4101)
• The device specified for
exceeds the corresponding device range. (For Universal
model QCPU only)
(Error code: 4101)
Program Example
(1) In the following program, the data from D100 to D103 and the data from R0 to R3 are added
when X1C turns ON, and the minimum value is searched in the addition result, then the
search results are stored to the devices from D200 to D202.
[Structured ladder]
[ST]
IF X1C THEN
D0:=4;
D150:=D100+R0;
D151:=D101+R1;
D152:=D102+R2;
D153:=D103+R3;
MINP(TRUE,D150,D0,D200);
END_IF;
s
d
d
s
s
d
d
1
2
22342001 (
B
IN)
37282010 (
B
IN)
22342001 (
B
IN)
59872019 (
B
IN)
22342001 (
B
IN)
Mi
n
i
mum
va
l
ue
L
ocat
i
on
Q
uant
i
t
y
d
d
s
s
s
s
d
d
+2
+4
+6
+1,
+2
+3
s
d
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......