TIME
The TIME function evaluates an OPC relative time, for example, H-10M. It can be used to obtain a time that is relative to the current time.
Function Name |
TIME |
Description |
Evaluates an OPC relative time. |
Arguments |
TIME(TIME VALUE) Where:
For more information on time values, see Date and Time. |
Returns |
TIME |
Example:
On a system that uses SCADAPack Modbus outstations, the Retrieve Demand List action for a point requires a Start Time and End Time to be specified. The Start Time and End Time define the range of data to be retrieved from the outstation.
A user method can be set up to execute the Retrieve Demand List method but with a relative start and end time instead of user defined start and end times. The relative start and end time are defined in the expression in the Method field for the user method. The expression uses the TIME function.
The expression for the user method is defined as:
RetrieveDemandList(0, TIME('D'), 0, TIME('D+1D'))
Where RetrieveDemandList
is the name of the method. The first 0 instructs the system to use the start time given in the second argument. The first TIME
function calculates the start time as the beginning of today. The second 0 informs the system to use the end time given in the last argument. The second TIME
function calculates the end time as the end of today.
Further Information
Using OPC Time Formats in the Geo SCADA Expert Guide to Core Configuration.