LTIME¶
64-bit duration value representing an interval of time.
Note
This feature requires IEC 61131-3 Edition 3. Use
--dialect iec61131-3-ed3 to enable it. See
Enabling Dialects and Features for details.
Size |
64 bits (millisecond resolution) |
Range |
about ±292 million years |
Default |
|
IEC 61131-3 |
Section 2.3.1 (Edition 3) |
Support |
Supported (Edition 3) |
Example¶
a := LTIME#1h;
b := LTIME#30m;
c := a + b; (* c = LTIME#1h30m *)
A duration is stored as a signed count of milliseconds. LTIME counts them
in 64 bits, so it reaches far past the ±24.8 days a 32-bit TIME holds.
An LTIME accepts a T# literal, which widens, but a TIME does not
accept an LTIME# one — that narrows, and is reported as
P4022.
Literals¶
LTIME#100ms
LTIME#5s
LTIME#2h
ltime#-500ms
Supported units: days (d), hours (h), minutes (m),
seconds (s), milliseconds (ms). Units are case-insensitive,
so LTIME#5S and LTIME#5s are equivalent. The prefix is likewise
case-insensitive.