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

3.10: Default initial values

3.10 Default initial values

All derived data types can be assigned new initial values that will override the defaults of the elementary data types. The new default value is defined with the type definition.

Examples:

     TYPE PRESSURE: REAL := 1.0; (* Default 1 bar *)     END_TYPE     TYPE PRESSURE_SENSOR:       STRUCT         INPUT: PRESSURE := 2.0; (* Override default *)         STATUS: BOOL := 0; (* Default 0 *)         CALIBRATION:              DATE := DT#1994-01-10; (* Install Date*)         HIGH_LIMIT: REAL := 30.0; (* Default limit*);         ALARM_COUNT: INT := 0; (* No alarms *)       END_STRUCT;     END_TYPE     TYPE  DEVICE_MODE:          (INITIALISING, RUNNING, STANDBY, FAULTY )      :=  STANDBY; (* Default enumerated value *)     END_TYPE

In array initialisation, each element in the array can be assigned a value. In the following example the first ten elements are assigned the value 1.1, the next five the value 1.3 and the last five the value 1.7.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Bath and Shower Fixtures
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.