Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 665

Table of Contents

Advertisement

15
C+5
C+6
Searching with the Setting to End the Sort Disabled
C+5: Always 0.
C+6: Always 0.
Searching with End Data Enabled to End the Sort
C+5: Sort end data (0000 to FFFF hex)
C+6: Always 0.
Searching with End Data Enabled to End the Sort
C+5: Lower word of end PLC memory address
C+6: Upper word of end PLC memory address
D1: First word of sorting results
15
D1
D2: Destination index register
D2
Operand Specifications
Word addresses
Area
CIO
WR
HR
AR
C
S
OK
OK
OK
OK
D1
D2
---
---
---
---
Flags
Name
Error Flag
Carry Flag
Function
The number of records specified by C starting from the record specified by S are sorted according to
the data in the specified location (1 word). When the sort operation has been completed, the Carry Flag
will turn OFF and the number of records that were sorted will be output to D1. If outputting to an index
register is specified in C+4, one address higher than the PLC memory address of the last word in the
sorted records is output to the specified index register. The sort direction is specified as ascending or
descending in C+3.
If split sorting is enabled in C+3, the sort will be executed over multiple cycles. The Carry Flag will be
ON while the sort operation is being executed and will turn OFF when the sort operation has been
completed. If the execution condition of RSORT turns OFF before the sort operation has been finished,
the sort will be continued the next time the execution condition turns ON.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
0
0
Number of records that were sorted
This word contains the number of records that were sorted.
0
IR**
One higher than the PLC memory address of the last word in
the range of records that was sorted. If index register output
is not specified in D+4, then 0000 0000 hex is stored in D2.
Indirect DM/EM
@DM
T
C
DM
EM
@EM
OK
OK
OK
OK
OK
---
---
---
---
---
Label
P_ER
• ON when the record length in C+1 is not between 1 and 1,024, inclusive.
• ON when the number of records specified in C times the record length in C+1 is greater than
32,768.
• ON when the number of records specified in C times the record length in C+1 is 0.
• ON when the sort data offset in C+2 is greater than one less than the record length in C+1.
• OFF in all other cases.
P_CY
• ON while the records are being sorted.
• OFF when the sort operation has been completed.
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
C+7 to C+86
addresses
Con-
stants
*DM
DR
*EM
---
OK
---
OK
---
OK
---
Operation
3. Instructions
0
System word area
Always clear C+7 to 0 before
starting to sort records.
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
OK
---
3
TR
bits
---
---
629

Advertisement

Table of Contents
loading

Table of Contents