Attention

These docs are a bit ambitious. The steps described are accurate but IronPLC cannot yet run programs.

P0039

Code

P0039

Message

Alias parent type is not declared

This error occurs when a type alias references a parent type that has not been declared.

Example

The following code will generate error P0039:

TYPE
    TypeAlias : UndeclaredType;  (* Error: UndeclaredType is not declared *)
END_TYPE

The type alias TypeAlias references UndeclaredType which has not been declared.

To fix this error, declare the parent type before creating the alias:

TYPE
    ParentType : INT;
    TypeAlias : ParentType;  (* Correct: ParentType is now declared *)
END_TYPE

Alternatively, use a built-in type:

TYPE
    TypeAlias : INT;  (* Correct: INT is a built-in type *)
END_TYPE