TimedCalculate Method (IPICalculation interface)

              

 

This method returns a PIValues collection that contains the result of evaluating the passed expression at the passed time points.

Syntax

object.TimedCalculate Timestamps,  Expression,  asynchStatus

The object placeholder is an object that evaluates to a reference to an IPICalculation interface.  This interface can be obtained from the Server object. This method is not supported on a PI 2 server.

 

The TimedCalculate method syntax has these parts:

Part Description
object An object expression that evaluates to a PIData object.
Timestamps Variant containing a SAFEARRAY of localDates, a SAFEARRAY of PITime objects, a SAFEARRAY of numerics interpreted as seconds since 1970 or a PIValues collection where the times are used and the values are ignored. See the settings section.

Expression

A string containing the expression to be evaluated.  The syntax for the expression follows the Performance Equation syntax as described in the server documentation.

AsyncStatus

A PIAsynchStatus object for launching an asynchronous call, determining the progress of, or canceling a lengthy call. [Optional]

Settings

The possible values in the array for Timestamps contained in the passed variant should conform to the following.  Note all timestamps in the array should be of the same type. In addition, the Timestamps argument can be a PIValues collection where the timestamps in each of the pivalue in the pivalues collection will be used as the time designator for the expression evaluation.

 

Setting Description
VT_BSTR A time/date string. Microsoft or PI Time string format. If a relative time string is specified here (e.g. -1h) it is interpreted relative to the current time on the local system where it is called. The PITimeFormat and DynamicTime objects described below can be used for more complex time specifications.
VT_DATE DATE representing a local date on the current system
VT_R4,VT_R8,VT_I2, VT_I4 A number representing seconds since 1970 UTC.
VT_DISPATCH, VT_UNKNOWN A variant containing a reference to a PITime object. This can also be the PITime interface from a PITimeFormat or DynamicTime object.

Remarks

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error Description
E_INVALIDARG Some of the function argument are not valid.
E_NOTIMPL This combination of the function arguments is not implemented at current PISDK version or not supported by this version of the PI Server.
PISDK_E_ERRCONVINPUT Problem converting input arguments to PI Server calling arguments.
E_ACCESSDENIED No read access to PI Server
PISDK_E_INVPEEXPR Invalid Expression Syntax
PISDK_E_PERUNTIMEERROR Expression evaluation runtime error
PISDK_E_DATENOTONLINE Archive not online for specified time range
PISDK_E_EVENTSRETRIEVE Other calculation error from the PI Server
PISDK_E_ERRCONVOUTPUT Error converting PI Server result to PISDK result format
Enabling Operational Intelligence