386 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 8 Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
Description: The SRT instruction sorts a set of values in one dimension (Dim to vary) of the
Array into ascending order.
This is a transitional instruction:
· In relay ladder, toggle the rung-condition-in from cleared to set each
time the instruction should execute.
· In structured text, condition the instruction so that it only executes on a
transition. See Structured Text Programming
.
Arithmetic Status Flags: Arithmetic status flags are affected.
Fault Conditions:
You must test and confirm that the instruction doesn’t
change data that you don’t want it to change.
The SRT instruction operates on contiguous memory. In
some cases, the instruction changes data in other
members of the tag. This happens if the length is too big
and the tag is a user-defined data type.
Make sure the Length does not cause the instruction to
exceed the specified Dimension to vary. If this happens,
unexpected results will occur.
A Major Fault Will Occur If Fault Type Fault Code
.POS < 0 or .LEN < 0 4 21
Dimension to vary does not exist for the
specified array
420
Instruction tries to access data outside of the
array boundaries
420