This function sends any values in the snapshot queue to the PI home node and returns a list of errors, if any. This function is called by pisn_putsnapshotq and pisn_sendexceptionq when the queue is full.
LPQERRORS PIWIN pisn_flushputsnapq ( void )
LPQERRORS type, which is a pointer to a qerrors structure as defined in piapi.h. The structure contains the system error and a list of point errors, if any. The structure and typedef are as follows:
typedef struct qerrors
int32 syserror; /* current system errors */
int32 numbpterrs; /* # of individual pt errors */
struct qerror qerr[MAXPUTSNAP]; /* list of pts in error */
typedef struct qerror
>0 System error
Number of points in error list
Point in error
-1 Point does not exist
-8 Time is after the current time or less than 0
-9 Illegal status or integer value
This function is useful if the snapshot rates are not fast enough to force flushing of the queue automatically. On DEC VAX systems, queuing is already part of the snapshot calls, thus this routine will always return syserror and numbpterrs = 0.
The same structure is used for each queue call, thus it is advisable to process the return information or copy the structure before making another queue call.
The following example sends a group of point values, collected at the same time to the queue and then calls flush. This reduces network traffic while minimizing the time that values remain in memory before being transmitted to the home node.
#define NUMINTERFACEPOINTS 10
... Load the pointNum array with the desired
.... load point values ...
qerrors = pisn_flushputsnapq();
printf("Error %ld with point %ld\n",qerror[i].error,