Sending and Retrieving Values from PI

PI-API functions that send and retrieve data from PI typically take a floating point and an integer argument typically referred to as rval and istat, respectively. The interpretation of these variables depends on the point type and the PI Systems.

When retrieving data from PI, the rval and istat are interpreted as follows:

Point Type

Rval

Istat

R

value if Istat = 0 otherwise undefined

0 if value is good, otherwise digital state

I

undefined

value if >= 0, otherwise digital state code

D

undefined

digital state code

 

When sending values to PI, the floating point and integer arguments are treated as above for sending real and integer data.

Digital states can be sent to real and integer tags rather than values to indicate status changes. PI on OpenVMS systems support a single, defined set of valid states. Windows NT and UNIX PI Systemss support a similar set of states called the system set; however the user may also define additional state sets. Any digital point in a Windows NT or UNIX PI Systems may be assigned one of these additional sets. These digital points can accept state values for both their individually assigned state set as well as the system set. For sending digital states, the following applies to the istat parameter:

Point Type

PI System

Meaning of Istat

R

All platforms

If <> 0 istat is a state in the system set. If = 0 then the rval is considered valid.

D

OpenVMS

If > 0, istat is an offset from the digital start code of the point.

If < 0 , istat is an absolute digital state

D

Windows NT, UNIX

If > 0, istat is an offset into the points defined state set.

If < 0 and > -32768, istat is an offset into the system state set.

I

All platforms

If > 0 istat is an integer value

If <0 istat is a system state code

This behavior was designed so that most programs can work with PI Systems on any platform without special logic to account for differences in the implementation of digital states.

Enabling Operational Intelligence