|
MLPIRESULT | mlpiEthercatSetConfigFiles (const MLPIHANDLE connection, const ULONG interfaceNumber, const WCHAR16 *iniPathFileName, const WCHAR16 *eniPathFileName) |
|
MLPIRESULT | mlpiEthercatControl (const MLPIHANDLE connection, const ULONG interfaceNumber, const ULONG command, UCHAR *dataIn, const ULONG dataSizeIn, UCHAR *dataOut, const ULONG dataSizeOut, ULONG *dataSizeOutRet) |
|
MLPIRESULT | mlpiEthercatSetMasterState (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatState state) |
|
MLPIRESULT | mlpiEthercatSetSlaveState (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const MlpiEthercatState slaveState) |
|
MLPIRESULT | mlpiEthercatGenerateEsi (const MLPIHANDLE connection, const WCHAR16 *eepromPathFileName, const WCHAR16 *esiPathFileName, const ULONG flags) |
|
MLPIRESULT | mlpiEthercatStartBusScan (const MLPIHANDLE connection, const ULONG interfaceNumber, const ULONG flags) |
|
MLPIRESULT | mlpiEthercatSetProcessData (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatProcessDataType pdType, const ULONG offset, UCHAR *data, const ULONG dataSize) |
|
Contains functions to configure the EtherCAT master and its slaves.
This function sets the master configuration (files will be loaded from local drive of control).
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | iniPathFileName | Path and filename of master configuration file (Bosch Rexroth specific). |
[in] | eniPathFileName | Path and filename of EtherCAT network information file. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Set the master configuration (files will be loaded from local drive of control).
2 ULONG interfaceNumber = 0;
3 WCHAR16 iniPathFileName[] = L"/USER/EtherCAT.ini";
4 WCHAR16 eniPathFileName[] = L"/USER/EtherCAT.xml";
5 MLPIRESULT result = mlpiEthercatSetConfigFiles(connection, interfaceNumber, iniPathFileName, eniPathFileName);
This function enables raw data exchange with the EtherCAT master stack.
- Attention
- It is mainly intended to be used by engineering systems like Bosch Rexroth IndraWorks. In standard use cases please use type specified functions instead.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | command | Internal command number. |
[in] | dataIn | Pointer to input bytes. |
[in] | dataSizeIn | Number of input bytes. |
[out] | dataOut | Pointer to output bytes. |
[in] | dataSizeOut | Maximum number of output bytes (size provided by dataSizeOutRet). |
[out] | dataSizeOutRet | Number of output bytes returned. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // This function should only be used internally.
This function sets the a new master state.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | state | New master state. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Set a new master state.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatState state = MLPI_ETHERCAT_STATE_INIT;
4 MLPIRESULT result = mlpiEthercatSetMasterState(connection, interfaceNumber, state);
This function sets a new slave state.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | addressType | Address type. |
[in] | address | Slave address (depending on addressType). |
[in] | slaveState | New slave state. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Set a new slave state.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatAddressType addressType = MLPI_ETHERCAT_AUTO_INCREMENT;
5 MlpiEthercatState slaveState = MLPI_ETHERCAT_STATE_PREOP;
6 MLPIRESULT result = mlpiEthercatSetSlaveState(connection, interfaceNumber, addressType, address, slaveState);
This function generates an EtherCAT Slave Information (Device Description) from an EEPROM image.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | eepromPathFileName | Path and filename of SII image. |
[in] | esiPathFileName | Path and filename where ESI will be generated. |
[in] | flags | Behavior of Esi generator. Currently set to zero. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Generate an EtherCAT Slave Information (Device Description) from an EEPROM image.
2 WCHAR16 eepromPathFileName[] = L"/USER/Eeprom.bin";
3 WCHAR16 esiPathFileName[] = L"/USER/Box1.xml";
5 MLPIRESULT result = mlpiEthercatGenerateEsi(connection, eepromPathFileName, esiPathFileName, flags);
This function starts the bus scan procedure of the master.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | flags | Flags specifying the behavior of bus scan (e.g. if serial number should be checked). |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Start the bus scan procedure of the master.
2 ULONG interfaceNumber = 0;
4 MLPIRESULT result = mlpiEthercatStartBusScan(connection, interfaceNumber, flags);
This function writes byte stream to process data (consistent).
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | pdType | Process data type. |
[in] | offset | Byte offset inside process data (where writing starts). |
[in] | data | Pointer to data image where data will be copied from. pbyData has to provide at least ulNumBytes of content. |
[in] | dataSize | Number of bytes to be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Write byte stream to process data (consistent).
2 ULONG interfaceNumber = 0;
3 MlpiEthercatProcessDataType pdType = MLPI_ETHERCAT_PD_TYPE_INPUTS;
6 ULONG dataSize = _countof(data);
7 MLPIRESULT result = mlpiEthercatSetProcessData(connection, interfaceNumber, pdType, offset, data, dataSize);