Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Name, Attribute, Unit
Collaboration diagram for Name, Attribute, Unit:

Functions

MLPIRESULT mlpiParameterReadName (const MLPIHANDLE connection, const ULLONG address, const ULLONG sidn, WCHAR16 *name, const ULONG numElements)
 
MLPIRESULT mlpiParameterReadAttribute (const MLPIHANDLE connection, const ULLONG address, const ULLONG sidn, ULONG *attribute)
 
MLPIRESULT mlpiParameterReadUnit (const MLPIHANDLE connection, const ULLONG address, const ULLONG sidn, WCHAR16 *unit, const ULONG numElements)
 

Detailed Description

These functions read the name, the attribute and the unit of a parameter.

The Name, the attribute and the unit are parts of a parameter (Parameter structure, sercos element 2, 3 and 4).

Note
The defines and functions within 'util/mlpiParameterHelper.h' supports you to evaluate the sercos attribute.

Function Documentation

MLPIRESULT mlpiParameterReadName ( const MLPIHANDLE  connection,
const ULLONG  address,
const ULLONG  sidn,
WCHAR16 name,
const ULONG  numElements 
)

This function reads the name of a parameter (Parameter structure, sercos element 2).

Parameters
[in]connectionHandle for multiple connections.
[in]addressAddress identifying the object to be accessed. Use macro MLPI_ADDRESS_x to generate an address field. This is the sercos address.
[in]sidnID of parameter to be accessed. Use macro MLPI_SIDN_x to get the desired ID.
[out]nameString where the 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 name of parameter 'C-0-0012'.
2 WCHAR16 name[512] = L"";
3 MLPIRESULT result = mlpiParameterReadName(connection, 0, MLPI_SIDN_C(12), name, _countof(name));
MLPIRESULT mlpiParameterReadAttribute ( const MLPIHANDLE  connection,
const ULLONG  address,
const ULLONG  sidn,
ULONG attribute 
)

This function reads the attribute of a parameter (Parameter structure, sercos element 3).

Parameters
[in]connectionHandle for multiple connections.
[in]addressAddress identifying the object to access. Use macro MLPI_ADDRESS_x to generate an address field. This is the sercos address.
[in]sidnID of parameter to be accessed. Use macro MLPI_SIDN_x to get the desired ID.
[out]attributePointer to variable where the attribute will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the attribute of parameter 'C-0-0023'.
2 ULONG attribute = 0;
3 MLPIRESULT result = mlpiParameterReadAttribute(connection, 0, MLPI_SIDN_C(23), &attribute);
MLPIRESULT mlpiParameterReadUnit ( const MLPIHANDLE  connection,
const ULLONG  address,
const ULLONG  sidn,
WCHAR16 unit,
const ULONG  numElements 
)

This function reads the unit of a parameter (d structure, sercos element 4).

Parameters
[in]connectionHandle for multiple connections.
[in]addressAddress identifying the object to be accessed. Use macro MLPI_ADDRESS_x to generate an address field. This is the sercos address.
[in]sidnID of parameter to be accessed. Use macro MLPI_SIDN_x to get the desired ID.
[out]unitString where the unit will be stored.
[in]numElementsNumber of WCHAR16 elements in 'unit' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the unit of parameter 'C-0-0051'.
2 WCHAR16 unit[16] = L"";
3 MLPIRESULT result = mlpiParameterReadUnit(connection, 0, MLPI_SIDN_C(51), unit, _countof(unit));