DVP-ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

API

61

Mnemonic

Operands

Function

Controllers

D

SER

P

Search a Data

ES2/EX2

SS2

SA2 SX2

Stack

 

 

SE

 

 

 

 

 

Type

 

Bit Devices

 

 

 

 

 

 

Word devices

 

 

 

 

 

 

Program Steps

 

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

 

K

H

KnX

KnY

KnM

KnS

T

C

D

E

 

F

SER, SERP: 9 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

 

 

 

 

*

*

 

*

 

*

 

*

 

*

*

 

 

 

DSER, DSERP: 17 steps

S2

 

 

 

 

 

 

*

*

*

*

 

*

 

*

 

*

 

*

*

*

 

*

D

 

 

 

 

 

 

 

 

 

 

*

 

*

 

*

 

*

 

*

*

 

 

 

 

 

 

 

 

 

N

 

 

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

16-bit

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

 

 

SE

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1: Start device of data stack

 

S2: Device to be searched

 

D: Start device for storing search

 

result (occupies 5 consecutive devices)

 

n: Stack length

 

 

 

 

 

 

 

 

 

 

 

Explanations:

98.SER instruction searches for the value stored in S2 from the data stack starting with S1, with a stack length n. The search results are stored in the 5 registers starting from D

99.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..

100.If operand S2 uses index F, only 16-bit instruction is available

101.If the instruction applied 32-bit instruction, operands S1, S2, D, n will specify 32-bit registers.

102.The range of operand n: n = 1~256 (16-bit instruction), n = 1~128 (32-bit instruction)

Program Example:

103.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.

104.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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

Content

Data to be

Data

Result

 

D

Content

Explanation

 

 

 

 

compared

No.

 

 

 

 

 

D10

88

 

S2

 

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

n

 

 

D14

100

 

D0=K100

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

 

 

 

9

Largest

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3 - 160

 

 

 

 

 

 

 

 

 

 

 

Page 276
Image 276
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Api, Ser