13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Advanced Function <strong>Instruction</strong>FUN113 D PSORTDATA SORTINGFUN113 D PSORTS : Starting register of source registers to sortD : Starting register of destination registers to store thedata after sortedL : Total register for sortingOperandRange TMR CTR HR IR OR SR ROR DR KT0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D40952∣127S ○ ○ ○ ○ ○ ○ ○ ○D ○ ○* ○L ○ ○ ○ ○●●When sort control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, will sort the registers withascending order (if A/D = 1) or descending order (if A/D = 0) and put the sorted result to the registers startingby D register.The valid data length of sort operation is between 2 and 127, other length will set the “ERR” to 1 and the sortoperation will not perform.X0113DP.SORTEN S : R 0A/DD :L :R 1010˙The example at left sorts the table comprised of R0~R9and stores the sorted data to the table locate atR10~R19.SDR0 1547 R10 0013R1 2314 R11 1547R2 7725 R12 1925R3 0013 R13 2314R4 5247 X0= R14 2796R5 1925 R15 5247R6 6744 R16 5319R7 5319 R17 6744R8 9788 R18 7725R9 2796R19 9788BeforeAfter7-100

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

Saved successfully!

Ooh no, something went wrong!