5
Categories and Use of Basic Application Instructions
DVP-PM Operation Instruction
5-74
API Mnemonic
Operands
Function
61
D SER P
Search a Data Stack
Controllers
20PM
10PM
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX
KnY
KnM KnS T C D E F
S
1
*
*
*
*
*
*
*
S
2
* *
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
N
*
*
*
SER, SERP: 9 steps
DSER, DSERP: 17 steps
Operands:
S
1
: Start device of data stack
S
2
: Device to be searched
D
: Start device for storing search result (occupies 5
consecutive devices)
n
: Stack length
Explanations:
1.
SER instruction searches for the value stored in
S
2
from the data stack starting with
S
1
, with a stack length
n
.
The search results are stored in the 5 registers starting from
D
2.
D
stores the total of the matched results;
D+1
stores the No. of device storing the first matched result;
D+2
stores the No. of device storing the last matched result;
D+3
stores the No. of device storing the smallest value;
D+4
stores the No. of device storing the biggest value..
3.
When SER is used as 16-bit instruction, Z device cannot be adopted; when SER is used as 32-bit instruction, V
device cannot be adopted.
4.
If the instruction applied 32-bit instruction, operands
S
1
,
S
2
,
D
,
n
will specify 32-bit registers.
5.
When specifying the bit device of KnX(Y/M/S), the starting No. should be a multiple of 16 in octal or decimal
format. For example, K1X0, K4Y20 (octal); K1M0, K4S16 (decimal).
6.
The range of operand
n
:
n
= 1~256 (16-bit instruction),
n
= 1~128 (32-bit instruction)
Program Example:
1.
When X0 = ON, the data stack D10~D19 are compared with D0 and the result is stored in D50~D54. If there is
no matched result, the content of D50~D52 will all be 0.
2.
D53 and D54 store the location of the smallest and biggest value. When there are more than one smallest and
biggest values, the devices with bigger No. will be recorded.
X0
SER
D10
D0
D50
K10
S
1
Content
Data to be
compared
Data No. Result
D
Content
Explanation
D10
88
0
D50
4
The total data numbers of equal value
D11
100
1
Equal
D51
1
The number of the first equal value
D12
110
2
D52
8
The number of the last equal value
D13
150
3
D53
7
The number of the smallest value
D14
100
4
Equal
D54
9
The number of the largest value
D15 300
5
D16 100
6 Equal
D17 5
7 Smallest
D18 100
8 Equal
D19 500
S
2
D0=K100
9 Largest
n
Summary of Contents for DVP-10PM
Page 1: ......
Page 45: ...2 Hardware Specifications and Wiring DVP PM Application Manual 2 30 MEMO...
Page 125: ...3 Functions of Devices in DVP PM DVP PM Application Manual 3 80 MEMO...
Page 341: ...8 Application Examples DVP PM Application Manual 8 2 Trajectory 3 Trajectory 4...
Page 427: ...9 Electrical CAM DVP PM Application Manual 9 74...
Page 437: ...10 Encrypting User Program DVP PM Application Manual 10 10 MEMO...
Page 458: ...11 G code Application DVP PM Application Manual 11 21 B O100 main program...
Page 561: ...14 Appendix DVP PM Application Manual 14 4 MEMO...