# LGF_CountArrayElements (FC / 1.0.0)

Overview

Author: Siemens Industry Support

## Short description

Count the number of array elements and returns the number of elements zero based (Array[0..x] of Type).

### Block Interface

| LGF_CountArrayElements (FC) |
--- | --- | ---
Variant |  |  | array |  | Ret_Val |  |  | DInt

### Input parameter

Identifier | Data type | Description
--- | --- | ---
array | Variant | Input array to check for number of elements

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | DInt | Number of elements in array (zero based); Returning `-1` if input variable is not type `array`; Returning `-2` if input variable is type `bool`;

### Status & Error codes

Code / Value | Identifier / Description
--- | ---
-1 | RETURN_NO_ARRAY No array is present at the input `array`
-2 | RETURN_NO_BOOL_ARRAYS_NOT_SUPPORTED Boolean arrays not supported

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Industry Support
| 10-06-2022 | First released version