Compiler Error C0048

Message

Array requires exact ‘<number>’ indexes

Message Cause

Too many or too few indexes are specified when using an array.

Solution

Specify as many indexes as there are dimensions assigned to the array.

Error Example

PROGRAM PLC_PRG
VAR
 arr1 : ARRAY[1..2,1..3] OF INT;
END_VAR

arr1[1] := 5;

--> C0048: Array requires exactly 2 indexes

Error Correction

arr1[1,2] := 5;