piar_calculation

This function returns evenly spaced values by calculating the result of the passed expression for the times from times[0] to times[count-1].

C format

int32 piar_calculation(

int32 PIPTR * count,

int32 times[],

float rvals[],

int32 istats[],

char PIPTR * calcstr);

Returns

>0

System error

Success

-105

Last time not after first time or
first time is <= 0

-121

Invalid count parameter

-8xx

Expression parsing error

-996

Message too big for PINet protocol

-998

Memory allocation error

Arguments

count (passed, returned)

Number of values

times (passed, returned)

Time stamps of values. Pass the start time in times[0] and the end time in times[count-1]. If you set times[count-1] to zero, PI will use the current time.

rvals (returned)

Values in engineering units

istats (returned)

Integer or status values

calcstr (passed)

Calculation string (equation) to evaluate, in PI performance equation syntax.

Usage Notes

An interpolated value is used for resolution code 1, 2 and 3 tags and previous value is used for resolution code 4 tags.

Numeric results are always returned in the rvals array even for integer points. The istats array is used only for digital states.

Enabling Operational Intelligence