Skip to main content

Compiler Warning C0525

Message: The type <type> cannot have a default value in this context

Possible error cause: The initial value of a VAR_INPUT has a custom data type.

Error correction: Remove the initial value.

Example 486. Example of the warning
FUNCTION Fun: INT
VAR_INPUT
      iPar : INT;
      xPar : BOOL;
      aInt : ARRAY [0..1] OF INT := [1, 2];
END_VAR

PROGRAM PLC_PRG
VAR
     aInt:ARRAY [0..1] OF INT := [1, 2];
END_VAR
Fun(1, TRUE, aInt);

The declaration of the variable aInt in the Fun function produces the following warning.

Message:

C0525: The type ARRAY [0..1] OF INT cannot have a default value in this context