pipt_nextptwsource

This function gets the next point number with a point source which matches the passed point source.

C format

int32 pipt_nextptwsource(

char source,

int32 PIPTR * pt );

Returns

>0

System error

0

Success

-1

No more points with passed source

Arguments

source (passed)

Point source character (case insensitive)

pt (passed, returned)

Point number

Usage Notes

Unlike the PI Toolkit call, the source character is not case sensitive - it is internally converted to upper case.

If the argument source is integer 0 (not character 0), this function returns all points in the Point Database.

For PI 2 Servers, the search is started at the passed point number plus 1. The function may be called with any point number.

For PI 3 Servers, the first call of this function begins searching for a matching point source at point number 1. Subsequent calls return the next point in the Point Database with the given point source. For subsequent calls, the passed point number is not used unless the value is 0. A zero argument reinitializes the search to point number 1. PI3 systems match only the first character of point source attributes.

Example

The following code segment demonstrates how to obtain the point numbers of all of the tags with a given point source:

int32 pt = 0;

int32 status = 0;

char ptsource = 'B';

while ( !(status = pipt_nextptwsource ( ptsource, &pt ))) {

/* add point number to list, do not modify pt */ 

}

/* check the status return */

if ( status != -1 ) {

/* probably signals a fatal error */ 

}

Enabling Operational Intelligence