Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Fieldbus control
Collaboration diagram for Fieldbus control:

Functions

MLPIRESULT mlpiIoReadFieldbusMasterList (const MLPIHANDLE connection, WCHAR16 *masterList, const ULONG numElements, ULONG *countOfMaster)
 
MLPIRESULT mlpiIoReadFieldbusMasterInfo (const MLPIHANDLE connection, const WCHAR16 *masterName, MlpiIoFieldbusMasterInfo *masterInfo)
 
MLPIRESULT mlpiIoReadFieldbusSlaveList (const MLPIHANDLE connection, const WCHAR16 *masterName, WCHAR16 *slaveList, const ULONG numElements, ULONG *countOfSlave)
 
MLPIRESULT mlpiIoReadFieldbusSlaveInfo (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, MlpiIoFieldbusSlaveInfo *slaveInfo)
 
MLPIRESULT mlpiIoReadFieldbusSlaveInfos (const MLPIHANDLE connection, const WCHAR16 *masterName, MlpiIoFieldbusSlaveInfo *slaveInfo, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoUpdateFieldbusIo (const MLPIHANDLE connection, const WCHAR16 *masterName)
 

Detailed Description

This library contains functions to control and manage fieldbus I/Os.

Function Documentation

MLPIRESULT mlpiIoReadFieldbusMasterList ( const MLPIHANDLE  connection,
WCHAR16 masterList,
const ULONG  numElements,
ULONG countOfMaster 
)

This function reads the name list of the available fieldbus masters on the target.

Parameters
[in]connectionHandle for multiple connections.
[out]masterListName list of fieldbus master. The names of the masters are separated by a semicolon(;).
[in]numElementsNumber of elements in masterList available to read.
[out]countOfMasterReturns number of returned fieldbus master names in parameter masterList.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the name list of fieldbus master.
2 WCHAR16 masterList[1024] = L"";
3 ULONG countOfMaster = 0;
4 MLPIRESULT result = mlpiIoReadFieldbusMasterList(connection, masterList, _countof(masterList), &countOfMaster);
MLPIRESULT mlpiIoReadFieldbusMasterInfo ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
MlpiIoFieldbusMasterInfo masterInfo 
)

This function reads the information about a fieldbus master.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[out]masterInfoInformation about the fieldbus master.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the information about the fieldbus master.
2 WCHAR16 masterName[] = L"Profibus_DP_Master";
3 MlpiIoFieldbusMasterInfo masterInfo;
4 memset(&masterInfo, 0, sizeof(masterInfo));
5 MLPIRESULT result = mlpiIoReadFieldbusMasterInfo(connection, masterName, &masterInfo);
MLPIRESULT mlpiIoReadFieldbusSlaveList ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
WCHAR16 slaveList,
const ULONG  numElements,
ULONG countOfSlave 
)

This function reads the name list of fieldbus slaves.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[out]slaveListName list of fieldbus slaves. The names of the slaves are separated by a semicolon(;).
[in]numElementsNumber of elements in slaveList available to read.
[out]countOfSlaveCount of fieldbus slaves.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the name list of fieldbus slaves.
2 WCHAR16 masterName[] = L"Profibus_DP_Master";
3 WCHAR16 slaveList[4096] = L"";
4 ULONG countOfSlave = 0;
5 MLPIRESULT result = mlpiIoReadFieldbusSlaveList(connection, masterName, slaveList, _countof(slaveList), &countOfSlave);
MLPIRESULT mlpiIoReadFieldbusSlaveInfo ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
MlpiIoFieldbusSlaveInfo slaveInfo 
)

This function reads the information about a fieldbus slave of a fieldbus master.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[out]slaveInfoInformation about the fieldbus slave.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the information about the fieldbus master.
2 WCHAR16 masterName[] = L"Profibus_DP_Master";
3 WCHAR16 slaveAddress[] = L"3";
4 MlpiIoFieldbusSlaveInfo slaveInfo;
5 memset(&slaveInfo, 0, sizeof(slaveInfo));
6 MLPIRESULT result = mlpiIoReadFieldbusSlaveInfo(connection, masterName, slaveAddress, &slaveInfo);
MLPIRESULT mlpiIoReadFieldbusSlaveInfos ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
MlpiIoFieldbusSlaveInfo slaveInfo,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads the information about the fieldbus slaves of a fieldbus master.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[out]slaveInfoInformation about the fieldbus slaves.
[in]numElementsNumber of elements in numElements available to read.
[out]numElementsRetPointer to data where the number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the information about the fieldbus master.
2 WCHAR16 masterName[] = L"Profibus_DP_Master";
3 MlpiIoFieldbusSlaveInfo slaveInfo[16];
4 ULONG numElementsRet = 0;
5 memset(&slaveInfo, 0, sizeof(slaveInfo));
6 MLPIRESULT result = mlpiIoReadFieldbusSlaveInfos(connection, masterName, slaveInfo, _countof(slaveInfo), &numElementsRet);
MLPIRESULT mlpiIoUpdateFieldbusIo ( const MLPIHANDLE  connection,
const WCHAR16 masterName 
)

This function performs a bus cycle to update the fieldbus I/Os of all attached slaves of a master.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Perform a bus cycle of the Profibus DP.
2 WCHAR16 masterName[] = L"Profibus_DP_Master";
3 MLPIRESULT result = mlpiIoUpdateFieldbusIo(connection, masterName);