PlotValues Method (PIData object)



Given a start and end time and number of desired plotting intervals (typically pixels) return values suitable for plotting in a PIValues collection.


object.PlotValues StartTime, EndTime, nIntervals[, AsyncStatus]

The PlotValues method syntax has these parts:

Part Description

An object expression that evaluates to a PIData object.

StartTime A Variant containing the time. See the Settings section for allowable values.
EndTime A Variant containing the time. See the Settings section for allowable values.
NumIntervals intervals for which to return plot information.  See Remarks.
AsyncStatus (Optional) A PIAsynchStatus object for launching an asynchronous call, determining the progress of, or canceling a lengthy call.  Currently unimplemented.


The possible values in the variant for StartTime and EndTime are:


The PlotValues method is designed to return a set of values over a time period that will produce the most accurate plot while minimizing the amount of data returned.  The caller specifies a time range and a number of intervals.  For each interval, the data available is examined and significant values are returned.  Each interval can produce up to 5 values if they are unique, the value at the beginning of the interval, the value at the end of the interval, the highest value, the lowest value and at most one exceptional point (digital state).   


PI3 servers impose a limit on the maximum number of events that can be returned with a single call. By default this is set at 150,000. This behavior can be changed on the server by editing the server's PITimeout table and adding or editing the value associated with the parameter ArcMaxCollect.


True asynchronous calling of this method is now invoked when a PIAsynchStatus object is passed as the AsynchStatus argument.  This means the call will return quickly (generally with success unless local argument checks fail) but the returned PIValues collection will be empty until the call completes. 

Trappable Errors

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

Error Description
pseOBJECTNOTPITIME A Variant passed for a time argument containing an object (IDispatch pointer) did not contain a PITime object or one of its derivatives.
pseVARIANTTYPEASTIME A Variant passed for a time argument did not contain a variant type that is supported.
tseTIMEINVALID Invalid time value.
pseVARIANTTIMETODOUBLE A variant passed for a timestamp could not be converted to a positive number of seconds since 1970.
pseDATETOTIMESTAMP A DATE passed for a timestamp could not be converted to a PI timestamp.
pseEVENTSRETRIEVE Failed to retrieve requested events. Check the description property for more information.
psePIVALUESCREATE Unable to create a PIValues collection to hold the results.

Enabling Operational Intelligence