pipt_updates

Pipt_updates is used to retrieve the information about changes in the Point Database. The pipt_signupforupdates call should be called during application startup to register for all future changes to the Point Database. A call to pipt_updates returns the point number, tagname, and type (mode) of change to that point. Mode returns add, edit, or delete.

C format

int32 pipt_updates(

int32 PIPTR * pt,

char PIPTR * tagname

int32 len,

int32 PIPTR * mode );

Returns

>0

System error

0

Success

-60

No more pid slots available

-61

No more changed tags

-62

Not signed up for point updates

-411

Tagname is truncated

-993

Server returned bad count

Arguments

pt (returned)

Point number

tagname (returned)

Name of updated tag

len (passed)

Length of the passed tagname buffer

mode (returned)

Update mode

Usage Notes

The length of the tagname buffer should be at least 13 characters long to avoid truncation on PI2 systems.

On PI 3 systems, tagnames greater than 12 characters will be truncated and a -411 return code will be given. The point number will still be valid.

Calling pipt_updates requires opening a file for each point updated. This can be slow; therefore, this routine should not be called more often than once every 5 to 10 minutes.

The following defines are provided in piapi.h to be used with the mode parameter:

/* pipt_updates defines */

#define NOTAGS 0

#define POINTCREATE 1

#define POINTEDIT 2

#define POINTDELETE 3

When calling pipt_updates from a distributed node, pipt_signupforupdates will automatically be called if the initial call returns "not signed up".

Example

See the function pipt_signupforupdates.

Enabling Operational Intelligence