This function returns exception values for points which have previously been registered with the PI System exception server (Update Manager subsystem). This function uses Visual Basic variants for the returned values instead of PI_EVENT structures.

Visual Basic format

Declare Function pisn_evmexceptx Lib "piapi32.dll" (
Val As Variant,
Timeval As PITimeStamp,
ByVal FuncCode&) As Long



All values have been returned


System error




Point not found


No points signed up for exceptions


Exception buffer overflowed


Invalid funccode


Not implemented


Bad length for bval


Memory allocation error


Value truncated



Count (passed, modified)

When passed, indicates the number of values to retrieve in this evmexceptions call. When returned, indicates the number actually retrieved.

PTnum (modified)

PI point number.

typeX (modified)

PI value type.

Val (modified)

Event returned for ptnum.

istat (modified)

Digital state code.

Flags (modified)

Data quality flags.

PITimeStamp (modified)

PITIMESTAMP structure.

FuncCode (passed)

Code indicating type of call. Three values are possible:

GETFIRST: obtains data from the PI System and returns data for the first PI point.
GETNEXT returns data for the next PI point.
GETSAME: returns the same data value as returned by the last call using GETNEXT or GETFIRST.

Usage Notes

A call using the function code GETFIRST must be made first, otherwise PI_NOMOREVALUES will be returned.

The points must first be registered with the update manager using the pisn_evmestablish function. If a point’s exception values are no longer needed, pisn_evmdisestablish may be used to remove it from the update manager’s list of points to queue.

Enabling Operational Intelligence