This function retrieves all units with a definition for the passed alias. 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_getunitswalias(

char PIPTR * alias

char PIPTR * unit,

int32 len,

int32 index,

int32 PIPTR * number );




System error


Passed alias not defined for any unit


Index out or range


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


No batch subsystem present on server.


alias (passed)

Alias name

unit (returned)

Unit name

len (passed)

Size of passed unit buffer

index (passed)

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

number (returned)

Total number of units found

Usage Notes


char unit[81] = "reactor1"; 

char alias[81]; 

int32 n, index2; 

int32 len = sizeof(tag); 

int32 result; 

result = piba_getunitswalias ( alias, unit,  

sizeof(unit),    0, &n ); 

for ( index2 = 1; index2 < n; index2++ ) 

result = piba_getunitswalias ( alias, unit,
sizeof(unit), index2, &n ); 

Enabling Operational Intelligence