Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Common system functions
Collaboration diagram for Common system functions:

Functions

MLPIRESULT mlpiSystemGetVersionInfo (const MLPIHANDLE connection, const WCHAR16 *component, WCHAR16 *version, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetLanguage (const MLPIHANDLE connection, MlpiLanguage *language)
 
MLPIRESULT mlpiSystemSetLanguage (const MLPIHANDLE connection, const MlpiLanguage language)
 
MLPIRESULT mlpiSystemGetName (const MLPIHANDLE connection, WCHAR16 *name, const ULONG numElements)
 
MLPIRESULT mlpiSystemSetName (const MLPIHANDLE connection, const WCHAR16 *name)
 
MLPIRESULT mlpiSystemGetIpAddress (const MLPIHANDLE connection, WCHAR16 *ipAddress, const ULONG numElements)
 
MLPIRESULT mlpiSystemSetIpAddress (const MLPIHANDLE connection, const WCHAR16 *ipAddress)
 
MLPIRESULT mlpiSystemGetSubnetMask (const MLPIHANDLE connection, WCHAR16 *subnet, const ULONG numElements)
 
MLPIRESULT mlpiSystemSetSubnetMask (const MLPIHANDLE connection, const WCHAR16 *subnet)
 
MLPIRESULT mlpiSystemGetGateway (const MLPIHANDLE connection, WCHAR16 *gateway, const ULONG numElements)
 
MLPIRESULT mlpiSystemSetGateway (const MLPIHANDLE connection, const WCHAR16 *gateway)
 
MLPIRESULT mlpiSystemGetCurrentMode (const MLPIHANDLE connection, MlpiSystemMode *mode)
 
MLPIRESULT mlpiSystemSetTargetMode (const MLPIHANDLE connection, const MlpiSystemMode mode)
 
MLPIRESULT mlpiSystemGetTemperature (const MLPIHANDLE connection, FLOAT *temperature)
 
MLPIRESULT mlpiSystemGetTemperatureMax (const MLPIHANDLE connection, FLOAT *temperature)
 
MLPIRESULT mlpiSystemResetTemperature (const MLPIHANDLE connection)
 
MLPIRESULT mlpiSystemGetTargetId (const MLPIHANDLE connection, LLONG *targetId)
 
MLPIRESULT mlpiSystemGetCpuLoad (const MLPIHANDLE connection, FLOAT *load)
 
MLPIRESULT mlpiSystemGetCpuLoadMax (const MLPIHANDLE connection, FLOAT *load)
 
MLPIRESULT mlpiSystemResetCpuLoad (const MLPIHANDLE connection)
 
MLPIRESULT mlpiSystemGetOperationHours (const MLPIHANDLE connection, ULONG *operatingTime)
 
MLPIRESULT mlpiSystemGetDateAndTimeUtc (const MLPIHANDLE connection, MlpiDateAndTime *dateTime)
 
MLPIRESULT mlpiSystemSetDateAndTimeUtc (const MLPIHANDLE connection, MlpiDateAndTime dateTime)
 
MLPIRESULT mlpiSystemSetDateAndTimeUtcByNtp (const MLPIHANDLE connection, const ULONG timeout, const WCHAR16 *server, const USHORT port=0)
 
MLPIRESULT mlpiSystemGetSerialNumber (const MLPIHANDLE connection, WCHAR16 *serialNumber, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetHardwareDetails (const MLPIHANDLE connection, WCHAR16 *hardwareDetails, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetLocalBusConfiguration (const MLPIHANDLE connection, WCHAR16 *configuration, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetFunctionModulBusConfiguration (const MLPIHANDLE connection, WCHAR16 *configuration, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetFunctionModuleHardwareDetails (const MLPIHANDLE connection, const ULONG functionModuleNum, WCHAR16 *hardwareDetails, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetMacAddress (const MLPIHANDLE connection, WCHAR16 *macAddress, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetMemoryInfo (const MLPIHANDLE connection, MlpiMemoryInfo *memoryInfo)
 
MLPIRESULT mlpiSystemGetSpecialPath (const MLPIHANDLE connection, const MlpiSpecialPath pathIdentifier, WCHAR16 *path, const ULONG numElements)
 
MLPIRESULT mlpiSystemGetSpecialPathInfo (const MLPIHANDLE connection, const MlpiSpecialPath pathIdentifier, MlpiSpecialPathInfo *pathInfo)
 
MLPIRESULT mlpiSystemGetRootPaths (const MLPIHANDLE connection, WCHAR16 *paths, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiSystemClearError (const MLPIHANDLE connection)
 
MLPIRESULT mlpiSystemReboot (const MLPIHANDLE connection)
 
MLPIRESULT mlpiSystemCleanup (const MLPIHANDLE connection)
 
MLPIRESULT mlpiSystemGetLicenseInformation (const MLPIHANDLE connection, WCHAR16 *licenses, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiSystemGetLimit (const MLPIHANDLE connection, MlpiSystemLimit limit, LLONG *value)
 

Detailed Description

Contains functions used to read different information of the target device.

Function Documentation

MLPIRESULT mlpiSystemGetVersionInfo ( const MLPIHANDLE  connection,
const WCHAR16 component,
WCHAR16 version,
const ULONG  numElements 
)

This function returns the version information of different components of the device. The component name has to be given as string. The following constants are already defined by the MLPI:

Parameters
[in]connectionHandle for multiple connections.
[in]componentString that identifies the component for which version string was read (see global constants e.g. MLPI_VERSION_FIRMWARE).
[out]versionString where the version information will be stored. Note that the format of the version information string may differ depending on the selected component.
[in]numElementsNumber of WCHAR16 elements in 'version' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the firmware version of the device.
2 WCHAR16 version[128] = L"";
3 MLPIRESULT result = mlpiSystemGetVersionInfo(connection, MLPI_VERSION_FIRMWARE, version, _countof(version));
MLPIRESULT mlpiSystemGetLanguage ( const MLPIHANDLE  connection,
MlpiLanguage language 
)

This function reads the current system language of the device (MlpiLanguage).

Parameters
[in]connectionHandle for multiple connections.
[out]languagePointer to variable where the currently selected system language will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the current system language of the device.
2 MlpiLanguage language = MLPI_LANGUAGE_GERMAN;
3 MLPIRESULT result = mlpiSystemGetLanguage(connection, &language);
MLPIRESULT mlpiSystemSetLanguage ( const MLPIHANDLE  connection,
const MlpiLanguage  language 
)

This function writes the system language of the device (MlpiLanguage).

Parameters
[in]connectionHandle for multiple connections.
[in]languageSystem language of the device to which it has to be switched.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the system language of the device.
2 MlpiLanguage language = MLPI_LANGUAGE_GERMAN;
3 MLPIRESULT result = mlpiSystemSetLanguage(connection, language);
MLPIRESULT mlpiSystemGetName ( const MLPIHANDLE  connection,
WCHAR16 name,
const ULONG  numElements 
)

This function reads the device name.

Parameters
[in]connectionHandle for multiple connections.
[out]nameString where the device name will be stored.
[in]numElementsNumber of WCHAR16 elements in 'name' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the device name.
2 WCHAR16 name[128] = L"";
3 MLPIRESULT result = mlpiSystemGetName(connection, name, _countof(name));
MLPIRESULT mlpiSystemSetName ( const MLPIHANDLE  connection,
const WCHAR16 name 
)

This function writes the device name.

Parameters
[in]connectionHandle for multiple connections.
[in]nameString which to be written to the device name.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the device name.
2 WCHAR16 name[] = L"Control_42";
3 MLPIRESULT result = mlpiSystemSetName(connection, name);
MLPIRESULT mlpiSystemGetIpAddress ( const MLPIHANDLE  connection,
WCHAR16 ipAddress,
const ULONG  numElements 
)

This function reads the IP address of the device. Value is a string in quad-dotted notation of four decimal integers, e.g. "192.168.001.001" (IPv4).

Parameters
[in]connectionHandle for multiple connections.
[out]ipAddressString where the IP address will be stored.
[in]numElementsNumber of WCHAR16 elements in 'ipAddress' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the IP address of the device.
2 WCHAR16 ipAddress[128] = L"";
3 MLPIRESULT result = mlpiSystemGetIpAddress(connection, ipAddress, _countof(ipAddress));
MLPIRESULT mlpiSystemSetIpAddress ( const MLPIHANDLE  connection,
const WCHAR16 ipAddress 
)

This function writes the IP address of the device. Value is a string in quad-dotted notation of four decimal integers, e.g. "192.168.001.001" (IPv4). A reboot is necessary for the new IP address to become active.

Parameters
[in]connectionHandle for multiple connections.
[in]ipAddressString to be written to the IP address.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the IP address of the device.
2 WCHAR16 ipAddress[] = L"192.168.1.42";
3 MLPIRESULT result = mlpiSystemSetIpAddress(connection, ipAddress);
MLPIRESULT mlpiSystemGetSubnetMask ( const MLPIHANDLE  connection,
WCHAR16 subnet,
const ULONG  numElements 
)

This function reads the subnet mask of the device. Value is a string in quad-dotted notation of four decimal integers, e.g. "255.255.255.000" (IPv4).

Parameters
[in]connectionHandle for multiple connections.
[out]subnetString where the subnet mask will be stored.
[in]numElementsNumber of WCHAR16 elements in 'subnet' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the subnet mask of the device.
2 WCHAR16 subnet[128] = L"";
3 MLPIRESULT result = mlpiSystemGetSubnetMask(connection, subnet, _countof(subnet));
MLPIRESULT mlpiSystemSetSubnetMask ( const MLPIHANDLE  connection,
const WCHAR16 subnet 
)

This function writes the subnet mask of the device. Value is a string in quad-dotted notation of four decimal integers, e.g. "255.255.255.000" (IPv4).

Parameters
[in]connectionHandle for multiple connections.
[in]subnetString to be written to the subnet mask.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the subnet mask of the device.
2 WCHAR16 subnet[] = L"255.255.255.0";
3 MLPIRESULT result = mlpiSystemSetSubnetMask(connection, subnet);
MLPIRESULT mlpiSystemGetGateway ( const MLPIHANDLE  connection,
WCHAR16 gateway,
const ULONG  numElements 
)

This function reads the gateway address of the device. Value is a string in quad-dotted notation of four decimal integers, e.g. "192.168.001.001" (IPv4).

Parameters
[in]connectionHandle for multiple connections.
[out]gatewayString where the gateway address will be stored.
[in]numElementsNumber of WCHAR16 elements in 'gateway' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the gateway address of the device.
2 WCHAR16 gateway[128] = L"";
3 MLPIRESULT result = mlpiSystemGetGateway(connection, gateway, _countof(gateway));
MLPIRESULT mlpiSystemSetGateway ( const MLPIHANDLE  connection,
const WCHAR16 gateway 
)

This function writes the gateway address of the device. Value is a string in quad-dotted notation of four decimal integers, e.g. "192.168.001.001" (IPv4).

Parameters
[in]connectionHandle for multiple connections.
[in]gatewayString to be written to the gateway address.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the gateway address of the device.
2 WCHAR16 gateway[] = L"192.168.1.1";
3 MLPIRESULT result = mlpiSystemSetGateway(connection, gateway);
MLPIRESULT mlpiSystemGetCurrentMode ( const MLPIHANDLE  connection,
MlpiSystemMode mode 
)

This function reads the current device mode (MlpiSystemMode).

Parameters
[in]connectionHandle for multiple connections.
[out]modePointer to variable where the current mode of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the current mode of device.
2 MlpiSystemMode mode = MLPI_SYSTEMMODE_P0;
3 MLPIRESULT result = mlpiSystemGetCurrentMode(connection, &mode);
MLPIRESULT mlpiSystemSetTargetMode ( const MLPIHANDLE  connection,
const MlpiSystemMode  mode 
)

This function writes the device mode (MlpiSystemMode). After writing the mode, the device will NOT be in this mode. It will be in the process of switching to this mode. In order to switch to a certain mode and perform an action while in this mode, you have to set the mode then read it back until the desired mode is reached.

Parameters
[in]connectionHandle for multiple connections.
[in]modeMode of the device to which it has to be switched.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the mode to which the device should be switched.
2 MlpiSystemMode mode = MLPI_SYSTEMMODE_P2;
3 MLPIRESULT result = mlpiSystemSetTargetMode(connection, mode);
MLPIRESULT mlpiSystemGetTemperature ( const MLPIHANDLE  connection,
FLOAT temperature 
)

This function reads the current temperature of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]temperaturePointer to variable where the current temperature of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the current temperature of the device.
2 FLOAT temperature = 0.0;
3 MLPIRESULT result = mlpiSystemGetTemperature(connection, &temperature);
MLPIRESULT mlpiSystemGetTemperatureMax ( const MLPIHANDLE  connection,
FLOAT temperature 
)

This function reads the maximum temperature of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]temperaturePointer to variable where the maximum temperature of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the maximum temperature of the device.
2 FLOAT temperature = 0.0;
3 MLPIRESULT result = mlpiSystemGetTemperatureMax(connection, &temperature);
MLPIRESULT mlpiSystemResetTemperature ( const MLPIHANDLE  connection)

This function reset the temperature values of the device to the current temperature.

Parameters
[in]connectionHandle for multiple connections.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Reset the temperature values of the device.
2 MLPIRESULT result = mlpiSystemResetTemperature(connection);
MLPIRESULT mlpiSystemGetTargetId ( const MLPIHANDLE  connection,
LLONG targetId 
)

This function reads the target ID of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]targetIdPointer to variable where the target ID of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Get the target ID
2 LLONG targetId = 0;
3 MLPIRESULT result = mlpiSystemGetTargetId(connection, &targetId);
MLPIRESULT mlpiSystemGetCpuLoad ( const MLPIHANDLE  connection,
FLOAT load 
)

This function reads the current CPU load device in percent.

Parameters
[in]connectionHandle for multiple connections.
[out]loadPointer to variable where the current cpu load of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the current CPU load of the device in percent.
2 FLOAT load = 0.0;
3 MLPIRESULT result = mlpiSystemGetCpuLoad(connection, &load);
MLPIRESULT mlpiSystemGetCpuLoadMax ( const MLPIHANDLE  connection,
FLOAT load 
)

This function reads the maximum CPU load of the device in percent.

Parameters
[in]connectionHandle for multiple connections.
[out]loadPointer to variable where the maximum cpu load of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the maximum CPU load of the device in percent.
2 FLOAT load = 0.0;
3 MLPIRESULT result = mlpiSystemGetCpuLoadMax(connection, &load);
MLPIRESULT mlpiSystemResetCpuLoad ( const MLPIHANDLE  connection)

This function reset the CPU load values of the device to the current CPU load.

Parameters
[in]connectionHandle for multiple connections.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Reset the CPU load values of the device.
2 MLPIRESULT result = mlpiSystemResetCpuLoad(connection);
MLPIRESULT mlpiSystemGetOperationHours ( const MLPIHANDLE  connection,
ULONG operatingTime 
)

This function reads the operating time in industrial minutes of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]operatingTimePointer to variable where the operating time of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the operating time of the device.
2 ULONG operatingTime = 0;
3 MLPIRESULT result = mlpiSystemGetOperationHours(connection, &operatingTime);
MLPIRESULT mlpiSystemGetDateAndTimeUtc ( const MLPIHANDLE  connection,
MlpiDateAndTime dateTime 
)

This function reads the system date and time (broken down time, UTC) of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]dateTimePointer to structure where the date and time of the device will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the date and time of the device.
2 MlpiDateAndTime dateTime;
3 memset(&dateTime, 0, sizeof(dateTime));
4 MLPIRESULT result = mlpiSystemGetDateAndTimeUtc(connection, &dateTime);
5 printf("\nSystem time: %04u-%02u-%02u %02u-%02u-%02u (UTC)",
6  dateTime.year, dateTime.month, dateTime.day,
7  dateTime.hour, dateTime.minute, dateTime.second);
MLPIRESULT mlpiSystemSetDateAndTimeUtc ( const MLPIHANDLE  connection,
MlpiDateAndTime  dateTime 
)

This function writes the system date and time (broken down time, UTC) of the device.

Parameters
[in]connectionHandle for multiple connections.
[in]dateTimeStructure to be written to the date and time of the device.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the date and time of the device to 2012-12-21 11:55:42.
2 MlpiDateAndTime dateTime;
3 memset(&dateTime, 0, sizeof(dateTime));
4 dateTime.year = 2012;
5 dateTime.month = 12;
6 dateTime.day = 21;
7 dateTime.hour = 11;
8 dateTime.minute = 55;
9 dateTime.second = 42;
10 MLPIRESULT result = mlpiSystemSetDateAndTimeUtc(connection, dateTime);
MLPIRESULT mlpiSystemSetDateAndTimeUtcByNtp ( const MLPIHANDLE  connection,
const ULONG  timeout,
const WCHAR16 server,
const USHORT  port = 0 
)

This function writes the system date and time of the device by a NTP server.

Parameters
[in]connectionHandle for multiple connections.
[in]timeoutTimeout until NTP server response.
[in]serverNTP server URI.
[in]portPort of NTP server (optional).
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Write the date and time of the device by a NTP server.
2 WCHAR16 server[] = L"192.168.1.1";
3 ULONG timeout = 5000;
4 MLPIRESULT result = mlpiSystemSetDateAndTimeUtcByNtp(connection, timeout, server);
MLPIRESULT mlpiSystemGetSerialNumber ( const MLPIHANDLE  connection,
WCHAR16 serialNumber,
const ULONG  numElements 
)

This function reads the serial number of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]serialNumberString where the serial number will be stored.
[in]numElementsNumber of WCHAR16 elements in 'serialNumber' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the serial number of the device.
2 WCHAR16 serialNumber[128] = L"";
3 MLPIRESULT result = mlpiSystemGetSerialNumber(connection, serialNumber, _countof(serialNumber));
MLPIRESULT mlpiSystemGetHardwareDetails ( const MLPIHANDLE  connection,
WCHAR16 hardwareDetails,
const ULONG  numElements 
)

This function reads the hardware details of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]hardwareDetailsString where the hardware details will be stored.
[in]numElementsNumber of WCHAR16 elements in 'hardwareDetails' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the hardware details of the device.
2 WCHAR16 hardwareDetails[512] = L"";
3 MLPIRESULT result = mlpiSystemGetHardwareDetails(connection, hardwareDetails, _countof(hardwareDetails));
MLPIRESULT mlpiSystemGetLocalBusConfiguration ( const MLPIHANDLE  connection,
WCHAR16 configuration,
const ULONG  numElements 
)

This function reads the local bus configuration of the device. Value is a string in semicolon separated format like "A005: netX (0x0100);A006: Sercos III PCI-BusMaster (0x000E);A007: n/a (0x0000);A254: SRAM (0x0013)". Each separated segment contains the address, the name and an identification code (hex format).

Parameters
[in]connectionHandle for multiple connections.
[out]configurationString where the local bus configuration will be stored.
[in]numElementsNumber of WCHAR16 elements in 'configuration' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the local bus configuration of the device.
2 WCHAR16 configuration[512] = L"";
3 MLPIRESULT result = mlpiSystemGetLocalBusConfiguration(connection, configuration, _countof(configuration));
MLPIRESULT mlpiSystemGetFunctionModulBusConfiguration ( const MLPIHANDLE  connection,
WCHAR16 configuration,
const ULONG  numElements 
)

This function reads the function module bus configuration of the device. Value is a string in semicolon separated format like "A001: SERCOS III (0x002B);A002: n/a (0x0000);A003: n/a (0x0000);A004: n/a (0x0000)". Each separated segment contains the address, the name and the identification code (hex format).

Parameters
[in]connectionHandle for multiple connections.
[out]configurationString where the function module bus configuration will be stored.
[in]numElementsNumber of WCHAR16 elements in 'configuration' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the function module bus configuration of the device.
2 WCHAR16 configuration[512] = L"";
3 MLPIRESULT result = mlpiSystemGetFunctionModulBusConfiguration(connection, configuration, _countof(configuration));
MLPIRESULT mlpiSystemGetFunctionModuleHardwareDetails ( const MLPIHANDLE  connection,
const ULONG  functionModuleNum,
WCHAR16 hardwareDetails,
const ULONG  numElements 
)

This function reads the hardware details of the function modules on the device.

Parameters
[in]connectionHandle for multiple connections.
[in]functionModuleNumValue indicating the number of the function module. Valid values are 1 to 4.
[out]hardwareDetailsString where the hardware details will be stored.
[in]numElementsNumber of WCHAR16 elements in 'hardwareDetails' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the hardware details of the function module no. 1.
2 WCHAR16 hardwareDetails[512] = L"";
3 ULONG functionModuleNum = 1;
4 MLPIRESULT result = mlpiSystemGetFunctionModuleHardwareDetails(connection, functionModuleNum, hardwareDetails, _countof(hardwareDetails));
MLPIRESULT mlpiSystemGetMacAddress ( const MLPIHANDLE  connection,
WCHAR16 macAddress,
const ULONG  numElements 
)

This function reads the MAC address of the device. Value is a string of format "00:00:00:00:00:00".

Parameters
[in]connectionHandle for multiple connections.
[out]macAddressString where the MAC address will be stored.
[in]numElementsNumber of WCHAR16 elements in 'macAddress' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the MAC address of the device.
2 WCHAR16 macAddress[128] = L"";
3 MLPIRESULT result = mlpiSystemGetMacAddress(connection, macAddress, _countof(macAddress));
MLPIRESULT mlpiSystemGetMemoryInfo ( const MLPIHANDLE  connection,
MlpiMemoryInfo memoryInfo 
)

This function retrieves some information about the current free RAM on the device. The figures are given in Bytes. The function can be used to trace the total system performance of the device.

Parameters
[in]connectionHandle for multiple connections.
[out]memoryInfoPointer to structure where the memory information will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read information about the current free RAM of the device.
2 MlpiMemoryInfo memoryInfo;
3 memset(&memoryInfo, 0, sizeof(MlpiMemoryInfo));
4 MLPIRESULT result = mlpiSystemGetMemoryInfo(connection, &memoryInfo);
5 
6 if (MLPI_FAILED(result)) {
7  printf("\ncall of MLPI function failed with 0x%08x!", result);
8 } else {
9  printf("\nRAM Total %lf MB", (DOUBLE)memoryInfo.totalVolatileBytes/1024.0/1024.0);
10  printf("\nRAM Free %lf MB", (DOUBLE)memoryInfo.freeVolatileBytes/1024.0/1024.0);
11  printf("\nNVRAM Total %lf MB", (DOUBLE)memoryInfo.totalNonvolatileBytes/1024.0/1024.0);
12  printf("\nNVRAM Free %lf MB", (DOUBLE)memoryInfo.freeNonvolatileBytes/1024.0/1024.0);
13 }
MLPIRESULT mlpiSystemGetSpecialPath ( const MLPIHANDLE  connection,
const MlpiSpecialPath  pathIdentifier,
WCHAR16 path,
const ULONG  numElements 
)

This function returns the platform specific absolute path of given symbolic path (MlpiSpecialPath). For example, it is possible to retrieve the absolute path of the system path on the connected device. This information can then be used to access files via ftp on the given path. This function is necessary because it is not guaranteed that the system path always has the same absolute path. Those special paths can vary in different operating systems or on storage devices.

Parameters
[in]connectionHandle for multiple connections.
[in]pathIdentifierEnumeration that identifies the path to query for.
[out]pathString where the special path will be stored. Starts and ends with path delimiter ("/").
[in]numElementsNumber of WCHAR16 elements in 'path' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the system path of the device.
2 WCHAR16 path[512] = L"";
3 MlpiSpecialPath pathIdentifier = MLPI_PATH_SYSTEM;
4 MLPIRESULT result = mlpiSystemGetSpecialPath(connection, pathIdentifier, path, _countof(path));
MLPIRESULT mlpiSystemGetSpecialPathInfo ( const MLPIHANDLE  connection,
const MlpiSpecialPath  pathIdentifier,
MlpiSpecialPathInfo pathInfo 
)

This function retrieves some information about the current spaces of special paths on the device. The figures are given in Bytes.

Parameters
[in]connectionHandle for multiple connections.
[in]pathIdentifierVariable that identifies the path to query for.
[out]pathInfoPointer to structure where the path information will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read information (total size, free disk space) about the path.
2 MLPIRESULT result = MLPI_S_OK;
3 MlpiSpecialPath pathIdentifier = MLPI_PATH_USER;
4 MlpiSpecialPathInfo pathInfo;
5 memset(&pathInfo, 0, sizeof(MlpiSpecialPathInfo));
6 MLPIRESULT result = mlpiSystemGetSpecialPathInfo(connection, pathIdentifier, &pathInfo);
7 
8 if (MLPI_FAILED(result)) {
9  printf("\ncall of MLPI function failed with 0x%08x!", result);
10 } else {
11  printf("\nUSR-Disk Total %lf MB", (DOUBLE)pathInfo.totalBytes/1024.0/1024.0);
12  printf("\nUSR-Disk Free %lf MB", (DOUBLE)pathInfo.freeBytes/1024.0/1024.0);
13 }
MLPIRESULT mlpiSystemGetRootPaths ( const MLPIHANDLE  connection,
WCHAR16 paths,
const ULONG  numElements,
ULONG numElementsRet 
)

This function returns all available platform specific root paths (e.g. "/ata0a/;/ata0b;..."). The root paths are separated by a semicolon (;). The information about the root paths can be used to access files via ftp. This function is necessary because it is not guaranteed that the root path always has the same absolute path, meaning the root paths can varies in different operating systems or on storage devices.

Parameters
[in]connectionHandle for multiple connections.
[out]pathsString where all available root paths will be stored.
[in]numElementsNumber of WCHAR16 elements in 'paths' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read all available root paths of the control.
2 MLPIRESULT result = MLPI_S_OK;
3 WCHAR16 paths[512] = L"";
4 ULONG numElementsRet = 0;
5 MLPIRESULT result = mlpiSystemGetRootPaths(connection, paths, _countof(paths), &numElementsRet);
MLPIRESULT mlpiSystemClearError ( const MLPIHANDLE  connection)

This function clears pending errors of the device.

Parameters
[in]connectionHandle for multiple connections.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Clear pending errors.
2 MLPIRESULT result = mlpiSystemClearError(connection);
MLPIRESULT mlpiSystemReboot ( const MLPIHANDLE  connection)

This function performs a reboot of the complete device. This is only allowed if the device is switched to initialization mode (MLPI_SYSTEMMODE_P0 using mlpiSystemSetTargetMode) before.

Parameters
[in]connectionHandle for multiple connections.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Reboot device.
2 MLPIRESULT result = mlpiSystemReboot(connection);
MLPIRESULT mlpiSystemCleanup ( const MLPIHANDLE  connection)

This function performs a reboot and total clean up of the complete device. This is only allowed if the device is switched to initialization mode (MLPI_SYSTEMMODE_P0 using mlpiSystemSetTargetMode) before. Please note that the device reboots immediately and that all project data is deleted during the next boot up.

Parameters
[in]connectionHandle for multiple connections.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Reboot and clean up device.
2 MLPIRESULT result = mlpiSystemCleanup(connection);
MLPIRESULT mlpiSystemGetLicenseInformation ( const MLPIHANDLE  connection,
WCHAR16 licenses,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads the license information of the device (raw format).

Parameters
[in]connectionHandle for multiple connections.
[out]licensesString where the licence information will be stored.
[in]numElementsNumber of WCHAR16 elements in 'licenses' available to read.
[in]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the license information of the device.
2 MLPIRESULT result = MLPI_S_OK;
3 WCHAR16 licenses[512] = L"";
4 ULONG numElementsRet = 0;
5 MLPIRESULT result = mlpiSystemGetLicenseInformation(connection, license, _countof(licenses), &numElementsRet);
MLPIRESULT mlpiSystemGetLimit ( const MLPIHANDLE  connection,
MlpiSystemLimit  limit,
LLONG value 
)

This function reads a limit (e.g. maximum number of applications) of the device (MlpiSystemLimit).

Parameters
[in]connectionHandle for multiple connections.
[out]limitLimit selector.
[out]valueLimit value.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the maximum number of application of device.
2 LLONG max = 0;
3 MLPIRESULT result = mlpiSystemGetLimit(connection, MLPI_SYSTEM_LIMIT_MAX_APPLICATIONS, &max);