12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Array (File)/Misc. <strong>Instructions</strong> (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE) 373File Sort (SRT)The SRT instruction sorts a set of values in one dimension (Dim tovary) of the Array into ascending order.Operands:Relay LadderOperand Type Format DescriptionArray SINT array tag array to sortINTDINTREALspecify the first element of the group ofelements to sortdo not use CONTROL.POS in the subscriptDimensionto varyDINTimmediate(0, 1, 2)which dimension to usedepending on the number of dimensions, theorder isarray[dim_0,dim_1,dim_2]array[dim_0,dim_1]array[dim_0]Control CONTROL tag control structure for the operationLength DINT immediate number of elements of the array to sortPosition DINT immediate current element in the arrayinitial value is typically 0Structured TextSRT(Array,Dimtovary,Control);The operands are the same as those for the relay ladderSRT instruction. However, you specify the Length and Position valuesby accessing the .LEN and .POS members of the CONTROL structure,rather than by including values in the operand list.CONTROL StructureMnemonic Data Type Description.EN BOOL The enable bit indicates that the SRT instruction is enabled..DN BOOL The done bit is set when the specified elements have been sorted..ER BOOL The error bit is set when either .LEN < 0 or .POS < 0. Either of these conditions also generatesa major fault..LEN DINT The length specifies the number of elements in the array on which the instruction.POS DINT The position contains the position of the current element that the instruction is accessing.Publication 1756-RM003I-EN-P - January 2007

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

Saved successfully!

Ooh no, something went wrong!