17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

69 D SORT Data sort<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Type Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F SORT: 11 steps<br />

S *<br />

m 1 * *<br />

DSORT: 21 steps<br />

m 2 * *<br />

D *<br />

n * * *<br />

PULSE 16-bit 32-bit<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE SE SE <strong>SX2</strong><br />

Operands:<br />

S: Start device for the source data m 1 : Groups of data to be sorted (m 1 =1~32) m 2 : Number of<br />

columns in the table (m 2 =1~6) D: Start device for the sorted data n: The No. of column to be<br />

sorted. (n=1~ m2)<br />

Explanations:<br />

154. The sorted data is stored in the m 1 × m 2 registers starting from the device designated in D.<br />

Therefore, if S and D designate the same register, the sorted results will be the same.<br />

155. SORT instruction is completed after m 1 times of scan. Once the SORT instruction is completed,<br />

the Flag M1029 (Execution completed flag) = ON.<br />

156. There is no limitation on the times of using this instruction in the program. However, only one<br />

instruction can be executed at a time<br />

Program Example:<br />

When X0 = ON, the sorting process starts. When the sorting is completed, M1029 will be ON. DO<br />

NOT change the data to be sorted during the execution of the instruction. If the sorting needs to be<br />

executed again, turn X0 from OFF to ON again.<br />

X0<br />

SORT D0 K5 K5 D50 D100<br />

3-181

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!