Skip to main content

Compiler Error C0004

Message: '<variable>' is not a component of '<structure>'

Possible error cause: Component access with "." to a variable that is not a structured value or does not exist as a component of the structure.

Error correction: Access a defined component, or change the definition of the component in the data type. The input assistance "List components" provides all valid access to this position.

Example 314. Example of the error:
TYPE DUT:
STRUCT
    x, y : INT;
END_STRUCT
END_TYPE

PROGRAM PLC_PRG
VAR
    test1 : DUT;
    test2 : INT;
END_VAR

test2 := test1.z;

Message:

C0032: Type 'unknown type: 'test1.z' can not be converted to type 'INT'

C0032: Type 'unknown type: 'test1.z' can not be converted to type 'INT'