pisn_putsnapshotqx

This function adds a new event to the PI Server snapshot. The function accepts several arguments in the argument list, but not all are used. Check the usage notes below to determine how the passed data is interpreted by PI. The queueing flag determines whether or not events are sent when each pisn_putsnapshotqx call is made or cached in an internal array and sent as an array of events.

Visual Basic format

Declare Function pisn_putsnapshotqx Lib "piapi32.dll" (
ByVal PtNum&,
drVal As Any,
iVal&,
bVal As Any,
bSize As Long,
iStat As Long,
Flags%,
TimeStamp As PITimeStamp,
ByVal Queueing&,
numbptErrs&,
qErrs As QERROR) As Long

C format

int32 PIPROC pisn_putsnapshotqx(

int32 ptnum,

float64 PIPTR *rval,

int32 PIPTR *ival,

void PIPTR *bval,

uint32 PIPTR *bsize,

int32 PIPTR *istat,

int16 PIPTR *flags,

PITIMESTAMP PIPTR *timestamp,

pibool queueing,

int32 PIPTR *numbpterrs,

QERROR PIPTR *qerrs);

Returns

>0

System error

Success

-1

Point not found

-991

Not implemented

-998

Memory allocation error

-10702

STATE Not Found

-15011

Unusable string value passed for numeric point

-15014

PIvalue Type or PIstring is Not Integer

-15017

PIvalue Type is Not Allowed For This Call

-30000

Success, but some points had errors

-30200

No data provided

Arguments

ptnum (passed)

PI point number.

drval (passed)

Floating-point value in engineering units. This value will be sent to PI if bval is NULL.

ival (passed)

Integer value in engineering units. This value will be sent to PI if bval is NULL, and drval is NULL.

bval (passed)

Pointer to string or byte array buffer. If non-NULL, this buffer will be sent to PI.

bsize (passed)

Buffer length. If NULL, or if the entry is zero, this function will measure the string length using the C language run-time library function strlen.

istat (passed)

Digital state code. For digital points, these are point values. No other values need be passed. For numerical points, these are digital state codes indicating status of the value. If NULL is passed, all values will receive a status code indicating good data.

flags (passed)

Data quality flag mask.

timestamp (passed)

Timestamps. If NULL, use the current time without subseconds.

queueing (passed)

Flag indicating whether this value should be queued. FALSE causes a putsnapshotx call without queueing and TRUE will cause snapshots to be stored until a PINet message is full or a pisn_flushputsnapqx is issued.

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 the pisn_putsnapshotx function call for an explanation of which arguments are required for each type of value.

See the pisn_flushputsnapqx function call for an explanation of snapshot queueing.

Enabling Operational Intelligence