A duration literal represents an interval of time, which can be positive or negative. Duration literals begin with the prefix T# or TIME#. Following the prefix is sequence of duration values and units. For example:
T#12h15m represents 12 hours and 15 minutes.
These duration units can be used:
Unit | Description |
---|---|
d | Days |
h | Hours |
m | Minutes |
s | Seconds |
ms | Milliseconds |
The prefix and duration units are not case-sensitive. For example:
T#12h15m is the same duration as TIME#12H15M.
The underscore (_) character can be used to improve readability. For example:
T#12h_15m
Negative intervals are represented using the minus (-) character immediately after the duration prefix. For example:
T#-250ms represents -250 milliseconds.
Real numbers can be used for fractional duration values. For example:
Time#1.5h represents 1 hour and 30 minutes.
IEC 61131-3 Second Edition: Table 7.
IEC 61131-3 Third Edition: Table 8.
To learn about functions that use or return duration values.
To learn about other language Common Elements.
For a list of all Unicode character codes used in IEC 61131-3 code.
For the meaning of terms used in Fernhill SCADA.