8 mac_getdevice, 9 mac_getipbyname – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 114

Advertising
background image

6.8

MAC_GetDevice

This function enables the user to get Multi-axes supervisor parameters

Syntax:

int MAC_GetDevice

( UINT uNum, LPTSTR szIP, LPTSTR szName );

Input Parameters:

UINT uNum

Device number in this search results

Output Parameter:

LPTSTR szIP - IP address of supervisor (string with length 16 bytes minimum).
LPTSTR szName - Name of supervisor (string with length 32 bytes minimum).

Return Value:

int - command status: if 0 - OK,

else - error code:

1 - The API library is not initialized;

2 - The device is not found;

Use MAC_GetLastError to retrieve the error string.

Sample:

int retVal = MAC_GetDevice( 0, szIP, szName );

6.9

MAC_GetIpByName

This function enables the user to get Multi-axes supervisor IP address by name

Syntax:

int MAC_GetIpByName

( LPCTSTR cszName, LPTSTR szIP );

Input Parameters:

LPCTSTR cszName - Name of supervisor (string with length 32 bytes minimum).

Output Parameter:

LPTSTR szIP - IP address of supervisor (string with length 16 bytes minimum).

Return Value:

int - command status: if 0 - OK,
else

error

code:

1

The API library is not initialized;

2

The device is not found;

Use MAC_GetLastError to retrieve the error string.

Sample:

int retVal = MAC_GetIpByName( _T("MAS_1"), szIP );

Maestro

Software Manual

The Maestro API

MAN-MASSW (Ver. Q)

6-7

Advertising