Skip to main content

descending

Short summary

This method sorts the Sortable in the descending order, so from great to low Result of the passed comparator is inverted. If no comparator is passed, compareTo of the Objects is used (inverted)

Return: ABORTED: While descending sort was pending,execute had a falling edge, BUSY: descending sort is in progress ERROR: descending sort was not able to finish (p.e. List changed) call descending(false) to reset SUCCESS: descending sort was finished

Parameters

NameTypeCommentKind
executeBOOLcontrol bit to start or abort the inverting, needs to be active until the ExecutionState is noz longer busyinput
comparatorCNM_AbstractObject.IComparatorthe comparator that should be used for the sort. Must not be changed while sort is in processinput

Code

Declaration

METHOD descending :CNM_ReturnTypes.SingleExecutionState;
VAR_INPUT
(*control bit to start or abort the inverting, needs to be active until the ExecutionState is noz longer busy*)
execute :BOOL;
END_VAR
VAR_INPUT
(*the comparator that should be used for the sort. Must not be changed while sort is in process*)
comparator :CNM_AbstractObject.IComparator := 0;
END_VAR