This function sends exception reports to the pi Snapshot and Archive. It is the recommended method of putting instrument or other real-time data into pi.
This function determines if the passed, new value is an exception. An exception is a value that satisfies one of these criteria:
The time between the new value and the last exception is greater than the maximum exception time for the point.
The time between the new value and the last exception is greater than the minimum exception time for the point and the difference between the new value and the last exception is greater than the exception deviation for the point.
If it is an exception, it sends the previous value if that value has a different time stamp than the last exception (oldvalue). It then always sends the new value when there is an exception.
This routine moves the new value to the previous value. If there is an exception, it also moves the new value to the old value. If newtime is passed as 0, the current server time is used.
The passed parameters are given the recommended data types for program storage. For example, the exception minimum and maximum times should be short (16 bit) rather than char or long. The time variables must be long (32 bit) variables.
int32 pisn_sendexceptions (
float PIPTR * oldval,
short PIPTR * oldstat,
int32 PIPTR * oldtime,
float PIPTR * prevval,
short PIPTR * prevstat,
int32 PIPTR * prevtime,
int32 PIPTR * count );
Point does not exist
Time is after the current time or less than 0
Illegal status or integer value
pi point type (R, I, or D)
oldval (passed, returned)
Value of last exception
oldstat (passed, returned)
Status of last exception
oldtime (passed, returned)
Time stamp of last exception
prevval (passed, returned)
Value of last scan
prevstat (passed, returned)
Status of last scan
prevtime (passed, returned)
Time stamp of last scan
Time stamp of new value or 0 for current time
Exception deviation in engineering units
Exception minimum time in seconds
Exception maximum time in seconds
Number of values sent to pi: 0,1, or 2