Skip to main content

Compiler Error C0230

Message: Type name '<data type>' not expected in this place

Possible error cause: The data type name of an enumeration is used at an invalid position.

Error correction: Check whether the data type name is used correctly at this location. Maybe there is a spelling error.

Example 449. Example of the error:
TYPE MyEnum :
(
    enum_member := 0
);
END_TYPE

PROGRAM PLC_PRG
VAR
    value : INT;
END_VAR
value := MyEnum;
MyEnum := value;

Message:

For PLC_PRG, the error message is issued 2x:

C0230: Type name 'MyEnum' not expected in this place

Error correction:

value := MyEnum.enum_member;
MyEnum.enum_member := value;