Specify a Relative Time in the OPC Relative Time Format
Fields for which you are required to specify a relative time have an adjacent browse button. You can use the browse button to display an Offset Window that you can use to specify the required time.
To manually enter a relative time, you enter a time value in the OPC Relative Time Format, using the following syntax:
<base> [ ( + ¦ - ) <interval> ]
where:
- <base> is a base time that is relative to ‘now’, the present time.
You can enter a base time in either short or long format—see the table below for the list of supported base times.
Example:
H
(The short OPC Relative Time Format for the start of the present hour.) - <interval> is an optional further offset that you can either add or subtract from the base time. You specify this offset in the OPC Time Format.
Example:
30M
(Half an hour.)You can specify both the <base> and <interval> in either short or long format. The syntax is case insensitive and character spaces are optional.
(If required, you can use an extension to this syntax, to Specify a Relative Time that Always Refers to a Time in the Past, or that takes into account the relevant time zone.)
Example:
An engineer wants the x-axis of a digital point’s Trend to display time over an interval that starts 15 minutes before the beginning of the current minute.
The engineer enters M - 15M in the Offset field, within the Trend section of the Digital Point Form.
M - 15M is the short OPC Relative Time Format that corresponds to ‘15 minutes before the start of the present minute’ (as M - 15M = the start of the present minute minus 15 minutes).
(The long OPC Relative Time Format equivalent of M - 15M is Minute - 15 Minutes.)
The base times that ClearSCADA supports are:
Base Time | Description | |
---|---|---|
Short Format | Long Format | |
S |
Second |
Beginning of the current second |
M |
Minute |
Beginning of the current minute |
H |
Hour |
Beginning of the current hour |
D |
Day |
Beginning of the current day |
W |
Week |
Beginning of the current week |
MO |
Month |
Beginning of the current month |
Y |
Year |
Beginning of the current year |
NOW |
NOW |
‘Now’ exactly (to the nearest 100 nanoseconds) |
D
is the short OPC Relative Time Format that represents 00:00am today (long format: Day)
D-1D
is the short OPC Relative Time Format for the start of the yesterday.(D is the start of today, and -1D moves that base time back by one day.)
D-2H
is the short OPC Relative Time Format for 10:00pm yesterday. (D is the start of today, and -2H moves that base time back by two hours.)
D+12H
is the short OPC Relative Time Format for midday today. (D is the start of today, and +12H adds 12 hours onto that base time.)
H+1H
is the short OPC Relative Time Format for the end of the present hour. (H is the start of the present hour, and +1H adds one hour onto that base time.)
H - 30M
is the short OPC Relative Time Format for the middle of the previous hour; where H indicates the start of the current hour, and 30M is the offset backwards in time from that hour. (Long format: Hour - 30 Minutes)
MO + 2W
represents the 14th day of this month (long format: Month + 2 Weeks)
D + 4H 30M
represents 04:30am today (long format: Day + 4 Hours 30 Minutes)