Skip to main content

Compiler Error C0380

Message: The Operators LOWER_BOUND and UPPER_BOUND are only supported for arrays of variable length.

Possible error cause: One of the two operators LOWER_BOUND or UPPER_BOUND is not used for an array of variable length.

Error correction: Use the operators LOWER_BOUND and UPPER_BOUND only for an array of variable length.

Tip

For compiler version 3.5.14.0 and higher, the operators can also be used for static arrays. As a result, the error C0380 occurs only in the case of earlier compiler versions.

Example 473. Example of the error:
FUNCTION_BLOCK POU
VAR_IN_OUT
    arrin : ARRAY [*] OF INT;
END_VAR
VAR
    arrtest : ARRAY [0..5] OF INT;
    test1: DINT;
    test2: DINT;
END_VAR

test1 := UPPER_BOUND(arrin, 1);
test2 := UPPER_BOUND(arrtest, 1);

Message:

C0380: The Operators LOWER_BOUND and UPPER_BOUND are only supported for arrays of variable length.