piar_putarcvaluesx

This function sends values to the PI Data Archive.

Visual Basic format

Declare Function piar_putarcvaluesx Lib "piapi32.dll" (
ByVal Count&,
ByVal Mode&,
PtNum&,
drVal As Any,
iVal&,
bVal As Any,
bSize&,
iStat&,
Flags%,
time0 As PITimeStamp,
Errors&) As Long

C format

int32 PIPROC piar_putarcvaluesx(
int32 count,
int32 mode,
int32 PIPTR *ptnum,
float64 PIPTR *drval,
int32 PIPTR *ival,
void PIPTR *bval,
uint32 PIPTR *bsize,
int32 PIPTR *istat,
int16 PIPTR *flags,
PITIMESTAMP PIPTR *timestamp,
int32 PIPTR *errors);

Returns

>0

System error

Success

-1

Point not found

-983

Invalid mode

-991

Not implemented

-992

Invalid bsize

Invalid count

-998

Memory allocation error

-10702

STATE Not Found

-11049

Invalid timestamp

-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

 

Arguments

count (passed)

The number of values in the passed arrays.

mode (passed)

Archive mode. These are defined in piapix.h.

ptnum (passed)

Array of PI point numbers.

drval (passed)

Floating-point values in engineering units.

ival (passed)

Integer values in engineering units.

bval (passed)

Pointer to string or byte array buffers without a terminating null.

bsize (passed)

The lengths in bytes of the buffers passed as bval not including the null terminator.

istat (passed)

For digital points, the point values. For all other point types, the digital state codes indicating status of the value.

flags (passed)

Data quality flag masks.

timestamp (passed)

Array of PITIMESTAMP strutctures.

errors (modified)

Returns the array of codes indicating success or failure for individual points.

Usage Notes

The arguments, including any NULL pointers, should be set according to the same mechanism as pisn_putsnapshotsx. The errors array will be filled in the same order as the list of points which was added to PI.

For server versions less than PI 3.2 SR1, this call reverts to the standard API calls to delete/replace values.

The following modes are valid for these calls (see piapix.h):

ARCNOREPLACE add unless event(s) exist at same time (PI 2.x)

ARCAPPEND add event regardless of existing events.

ARCREPLACE add event, replace if event at same time.

ARCREPLACEX replace existing event (fail if no event at time)

ARCDELETE remove existing event.

ARCAPPENDX add event regardless of existing events, with
 no compression.

Enabling Operational Intelligence