Attention

IronPLC implements many parts of the IEC 61131-3 standard and is working toward full Structured Text support. Key features still missing include structures and user defined function blocks.

Structure Types

A structure type defines a record with named fields of potentially different types.

IEC 61131-3

Section 2.3.3.1

Support

Partial

Syntax

TYPE
    type_name : STRUCT
        field_name : field_type ;
        ...
    END_STRUCT ;
END_TYPE

Example

TYPE
    Point : STRUCT
        X : REAL;
        Y : REAL;
    END_STRUCT;
END_TYPE

PROGRAM main
    VAR
        origin : Point;
    END_VAR

    origin.X := 0.0;
    origin.Y := 0.0;
END_PROGRAM

Fields are accessed using dot notation. Each field name must be unique within the structure.

See Also