piba_getunit

This function retrieves all units defined on the Server. index should be set to zero for the first call to the function and subsequent calls should increment index, up to number-1 to retrieve remaining unit names.

C format

int32 piba_getunit(

char PIPTR * unit,

int32 len,

int32 index,

int32 PIPTR * number );

Returns

>0

System error

Success

-1

No units defined

-5

Index out of range

-991,-994

API access to batch not supported by the version of PI on the Server

-1002

No batch subsystem present on Server.

Arguments

unit (returned)

Unit name

len (passed)

Size of passed unit buffer

index (passed)

Index into list of units. For example, if 5 units are defined, indexes 0 through 4 are valid.

number (returned)

Total number of units defined

Usage Notes

Example

 

char unit[81]; 

int32 number, index, result; 

if ( result ) 

return; 

for ( index = 1; index < number; index++ ) 

result = piba_getunit   ( unit, sizeof(unit), index,  

&number ); 

printf { "\n%s", unit ); 

Enabling Operational Intelligence