The following functions enable the management of arrays:

attention Attention

These functions may be not available on some targets. Please refer to OEM instructions for further details about available features.

ARCOUNT: search for occurrences of a value within an array

COUNT := ARCOUNT (ARR, PATTERN, STARTINDEX);

ARRAY : ANY  single or multi dimension array.
PATTERN : ANY searched value.
STARTINDEX : DINT  index of the position where to start - 0 to search in the complete array.

Return value

Number of occurrences found.

ARFILL: fill an array with a value

OK := ARFILL (ARR, VALUE);

ARRAY : ANY  single or multi dimension array.
PATTERN : ANY value to be copied in all array elements.

Return value

TRUE if successful.

ARFIND: search for the first occurence of a value within an array

INDEX := ARFIND (ARR, PATTERN, STARTINDEX);

ARRAY : ANY  single dimension array.
PATTERN : ANY searched value.
STARTINDEX : DINT  index of the position where to start - 0 to search in the complete array.

Return values

Index of the first occurrence found.

ARMAX: search for the maximum value within an array

Q := ARMAX (ARR);

ARRAY : ANY  single or multi dimension array.

Return value

Maximum value found found.

ARMIN: search for the minimum value within an array

Q := ARMIN (ARR);

ARRAY : ANY  single or multi dimension array.

Return value

Minimum value found found.

ARSORT: sort items of an an array

OK := ARSORT (ARR);

ARRAY : ANY  single dimension array.

Return value

TRUE if successful.

Arrays management functions

IEC 61131-3 Automation platform > Programming - Reference guide > Advanced operations > Arrays management functions

Previous chapterNext chapter


Created with the Personal Edition of HelpNDoc: Experience a User-Friendly Interface with HelpNDoc's Documentation Tool