TIME constants are used to operate the standard timer modules. The time constant TIME is of size 32 bit, resolution in milliseconds as specified by the IEC 61131-3 standard. Additionally, LTIME is supported as an extension to the standard as time base for high-resolution timers. LTIME is of size 64 bit and provides a resolution in nanoseconds.
The library standard64.lib provides functions for WSTRING strings.
t#<time declaration>
Instead of t#
, you can also use the following:
T#
time#
TIME#
The time declaration can include the following time units. They have to be used in the following sequence, but it is not required to use all of them.
D | d
: days
H | h
: hours
M | m
: minutes
S | s
: seconds
MS | ms
: milliseconds
Examples of correct TIME constants in an ST assignment
Example |
Description |
---|---|
|
– |
|
(* The highest component may be allowed to exceed its limit *) |
|
– |
Examples of incorrect usage
Example |
Description |
---|---|
|
(* limit exceeded in a lower component *) |
|
(* T# is missing *) |
|
(* incorrect order of entries *) |
LTIME#<time declaration>
The time declaration can include the time units as used with the TIME constant and additionally:
us: microseconds
ns: nanoseconds
Examples of correct LTIME constants in an ST assignment:
LTIME1 := LTIME#1000d15h23m12s34ms2us44ns
LTIME1 := LTIME#3445343m3424732874823ns
For further information, refer to the description of the Date and Time Data Types.