This function flushes the extended PI-API queue of snapshots, stored internally in the PI-API, to the PI Server. Events added to the snapshot queue will remain in the queue until explicitly sent to the PI Server with this function, or implicitly sent by filling the buffer with events. The queue holds either a maximum of 4 kilobytes of data or 192 events. Snapshot events are added to the extended PI-API queue by calling the pisn_putsnapshotqx, pisn_sendexceptionqx, or pisn_sendexceptqx function calls.

Visual Basic format

Declare Function pisn_flushputsnapqx Lib "piapi32.dll" (
qErrs As QERROR) As Long

C format

int32 PIPROC pisn_flushputsnapqx(

int32 PIPTR *numbpterrs,




System error



Point not found


Not implemented


Memory allocation error


STATE Not Found


Unusable string value passed for numeric point


PIvalue Type or PIstring is Not Integer


PIvalue Type is Not Allowed For This Call


Success, but some points had errors



numbpterrs (modified)

Returns the number of putsnapshotx errors.

qerrs (modified)

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

Usage Notes

The return codes from this flush call (explicitly sending the event queue to the PI server) may return the same status values as for the snapshot calls that use this queue (implicit send). The function code may return success or an error indicating that all or none of the values were sent to the PI server. If a warning code is received, then the numbpterrs value will indicate how many QERROR array members will contain error information.

This extended PI-API event queue is separate from that used by pisn_putsnapshotq.

Enabling Operational Intelligence