Programming Industrial Control Systems Using IEC 1131-3, Revised Edition

To assist program readability and ensure that data are used consistently, new data types can be defined from the elementary data types. A new data type is declared by framing the definition with TYPE and END_TYPE.
For example, all values for pressures could be held in a derived data type called PRESSURE which is based on the REAL data type. The type can be declared as:
TYPE PRESSURE : REAL; END_TYPE;
New composite data types can be derived by defining a structure from existing data types. A structure is declared by framing the definition with STRUCT and END_STRUCT. Each element of the composite data can be given a meaningful name.
For example, the data from a pressure sensor may consist of the following information:
The current pressure as an analogue value;
The status of the device, i.e. operating or faulty;
The calibration date;
The maximum safe operating value;
The number of alarms in the current operating period.
This can all be defined in a single structure as a new data type PRESSURE_SENSOR:
<a name="190"></a><a name="page66"></a> TYPE PRESSURE_SENSOR: STRUCT INPUT: PRESSURE; STATUS: BOOL; CALIBRATION: DATE;