beautypg.com

Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 329

background image

7 Application Instructions API 50-99

D V P - P L C A P P L I C AT I O N M A N U A L

7-45

API Mnemonic

Operands

Function

61

D SER P

Search a Data Stack

Controllers

ES/EX/SS SA/SX/SC EH/SV

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

PULSE 16-bit 32-bit

ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV

Operands:

S

1

: Start device for data stack comparison S

2

: Data to be compared D: Start device for storing comparison

result n: Length of data to be compared

Explanations:

1. When

S

2

are used in device F, only 16-bit instruction is applicable.

2.

D

will occupy 5 consecutive points.

3. Range

of

n

: for 16-bit instruction 1 ~ 256; for 32-bit instruction 1 ~ 128.

4.

See the specifications of each model for their range of use.

5. The

n

data in the registers starting from S

1

are compared with S

2

and the results are stored in the registers

starting from D.

6.

In the 32-bit instruction, S

1

, S

2

, D and n will designate 32-bit registers.

7. For

D

, the 16-bit counters and 32-bit counters in SA/SX/SC series MPU cannot be mixed when being used.

Program Example:

1.

When X0 = On, the data stack consist of D10 ~ D19 will be compared against D0 and the result will be stored in

D50 ~ D52. If there are equivalent values appearing during the comparison, D50 ~ D52 will all be 0.

2.

The data are compared algebraically. (-10 < 2).

3.

The No. of the register with the smallest value among the compared data will be recorded in D53; the biggest

will be recorded in D54. When there are more than one smallest value or biggest value, device D will record the

No. of the register with bigger value.

X0

SER

D10

D0

D50

K10

S

1

Content

Data to be

compared

Data No.

Result

D

Content

Description

D10 88

0

D50

4

Total number of data with
equivalent values

D11

100

1

Equal

D51

1

No. of the first equivalent value

D12

110

2

D52

8

No. of the last equivalent value

D13

150

3

D53

7

No. of the smallest value

D14

100

4

Equal

D54

9

No. of the biggest value

D15 300

5

D16 100

6

Equal

D17 5

7 Smallest

D18 100

8

Equal

n

D19 500

S

2



D0 = K100

9 Biggest