3. Instruction

Set

API

Mnemonic

Operands

Function

Controllers

 

69

D

SORT

 

Data sort

ES2/EX2 SS2 SA2 SX2

 

SE

 

 

Type

Bit Devices

 

Word devices

Program Steps

 

OP

X

Y

M

S K

H

KnX

KnY

KnM

KnS

T

C

D

E

 

F SORT: 11 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

DSORT: 21 steps

 

 

m1

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

m2

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

n

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16-bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

SE

SE

SE

Operands:

S: Start device for the source data m1: Groups of data to be sorted (m1 =1~32) m2: Number of

columns in the table (m2 =1~6) D: Start device for the sorted data n: The No. of column to be sorted. (n=1~ m2)

Explanations:

154.The sorted data is stored in the m1 × m2 registers starting from the device designated in D. Therefore, if S and D designate the same register, the sorted results will be the same.

155.SORT instruction is completed after m1 times of scan. Once the SORT instruction is completed, the Flag M1029 (Execution completed flag) = ON.

156.There is no limitation on the times of using this instruction in the program. However, only one instruction can be executed at a time

Program Example:

When X0 = ON, the sorting process starts. When the sorting is completed, M1029 will be ON. DO NOT change the data to be sorted during the execution of the instruction. If the sorting needs to be executed again, turn X0 from OFF to ON again.

X0

SORT

D0

K5

K5

D50

D100

3 - 1 8 1

Page 297
Image 297
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Sort, Data sort