pisn_sendexceptqx

This function is intended for use from Visual Basic. It adds a new event to the PI System Snapshot if it passes the exception test. The Visual Basic variant type is used to pass the data value. The queueing flag determines whether or not the data is queued until either 4kb of data or pisn_flushputsnapqx is called.

Visual Basic format

Declare Function pisn_sendexceptqx Lib "piapi32.dll" (
ByVal pt&,
ByVal typeX&,
oldVal As Variant,
oldistat&,
oldFlags%,
oldTime As PITimeStamp,
prevVal As Variant,
previstat&,
prevFlags%,
prevTime As PITimeStamp,
Val As Variant,
istat&,
Flags%,
newTime As PITimeStamp,
ByVal ExcDevEng#,
ByVal ExcMin#,
ByVal ExcMax#,
Count&,
ByVal Queueing&,
numbptErrs&,
qErrs As QERROR) As Long

Returns

>0

System error

Success

-991

Not implemented

-30000

Success, but some points had errors

-30200

No data provided

 

Arguments

pt (passed)

PI point number.

oldvalue (passed,modified)

Last value that passed the exception test. The structure is listed below in the Usage Notes.

prevvalue (passed,modified)

Last value to be tested for exception. If the last test was true, this will be the same as oldvalue. The structure is listed below in the Usage Notes.

newvalue (passed)

New value to be tested for exception.

excdeveng (passed)

Exception deviation in engineering units used in the exception test.

excmin (passed)

Exception minimum time in seconds used in the exception test.

excmax (passed)

Exception maximum time in seconds used in the exception test.

count (modified)

Number of values sent to the snapshot.

queueing (passed)

Flag indicating whether this value should be queued (TRUE or FALSE).

numbpterrs (modified)

The number of point errors for the queued data.

qerrs (modified)

An array of size 192 of QERROR structures allocated by the calling program.

Usage Notes

See pisn_sendexceptionqx for a description of the exception algorithm and the PI Data Archive manual for a description of the point attributes used in exception processing.

The variant types used in this function contain information regarding the type of value. Setting the variant using a floating point value will cause this function to read the value as a floating point value. Likewise, setting the value using a string will cause this function to read a string from the variant.

An internal data queue for the extended snapshot values is enabled by passing queuing = 1. This will queue about 4 kilobytes of data before making a network call to send the data to the PI server snapshot. The function pisn_flushsnapshotqx may also be used to send the data to the PI server. The QERROR array, if returned, must be declared by the calling program to a minimum array size of 192.

Enabling Operational Intelligence