|
MLPIRESULT | mlpiEthercatCoeGetOdList (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const MlpiEthercatOdListType listType, USHORT *indicies, const ULONG numElements, ULONG *numElementsRet) |
|
MLPIRESULT | mlpiEthercatCoeGetObjectDescription (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT objectIndex, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet) |
|
MLPIRESULT | mlpiEthercatCoeGetEntryDescription (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT objectIndex, const UCHAR subIndex, const UCHAR valueInfo, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet) |
|
MLPIRESULT | mlpiEthercatCoeSdoUpload (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT objectIndex, const UCHAR subIndex, const ULONG flags, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet) |
|
MLPIRESULT | mlpiEthercatCoeSdoDownload (const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT objectIndex, const UCHAR subIndex, const ULONG flags, UCHAR *data, const ULONG dataSize) |
|
Contains functions to communicate with slaves over CANopen application protocol over EtherCAT.
This function gets a list of object indices which are available in a EtherCAT CoE device.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | addressType | Address type. |
[in] | address | Slave address (depending on addressType). |
[in] | listType | List type. |
[out] | indicies | Data buffer for object list. |
[in] | numElements | Number of elements in 'indicies' available to read. |
[out] | numElementsRet | Number of elements used. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Get a list of object indices which are available in a EtherCAT CoE device.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatAddressType addressType = MLPI_ETHERCAT_AUTO_INCREMENT;
5 MlpiEthercatOdListType listType = MLPI_ETHERCAT_OD_LIST_TYPE_ALL;
6 USHORT indicies[30] = {0};
7 ULONG numElements = _countof(indicies);
8 ULONG numElementsRet = 0;
9 MLPIRESULT result = mlpiEthercatCoeGetOdList(connection, interfaceNumber, addressType, address, listType, indicies, numElements, &numElementsRet);
This function gets the object description for a specific object (SDO) in EtherCAT CoE device.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | addressType | Address type. |
[in] | address | Slave address (depending on addressType). |
[in] | objectIndex | Object index. |
[out] | data | Data buffer for object description (see ETG 1000 specification). |
[in] | dataSize | Size of buffer provided by data in bytes. |
[out] | dataSizeRet | Size of data written to data in bytes. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Get the object description for a specific object (SDO) in EtherCAT CoE device.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatAddressType addressType = MLPI_ETHERCAT_AUTO_INCREMENT;
5 USHORT objectIndex = 0;
6 UCHAR data[1024] = {0};
7 ULONG dataSize = _countof(data);
9 MLPIRESULT result = mlpiEthercatCoeGetObjectDescription(connection, interfaceNumber, addressType, address, objectIndex, data, dataSize, &dataSizeRet);
This function gets the object entry description for a specific object (SDO) in EtherCAT CoE device.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | addressType | Address type. |
[in] | address | Slave address (depending on addressType). |
[in] | objectIndex | Object index. |
[in] | subIndex | Sub index. |
[in] | valueInfo | Bit mask to define which information to determine (see ETG 1000 specification). |
[out] | data | Data buffer for entry description (see ETG 1000 specification). |
[in] | dataSize | Size of buffer provided by data in bytes. |
[out] | dataSizeRet | Size of data written to data in bytes. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Get the object entry description for a specific object (SDO) in EtherCAT CoE device.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatAddressType addressType = MLPI_ETHERCAT_AUTO_INCREMENT;
5 USHORT objectIndex = 0;
8 UCHAR data[1024] = {0};
9 ULONG dataSize = _countof(data);
10 ULONG dataSizeRet = 0;
11 MLPIRESULT result = mlpiEthercatCoeGetObjectDescription(connection, interfaceNumber, addressType, address, objectIndex, subIndex, valueInfo, data, dataSize, &dataSizeRet);
This function performs a CoE SDO upload from an EtherCAT slave device to the master.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | addressType | Address type. |
[in] | address | Slave address (depending on addressType). |
[in] | objectIndex | Object index. |
[in] | subIndex | Sub index. |
[in] | flags | Mailbox flags specifying the upload behavior. Bit 0: Complete Access, Bit 1-31: Reserved (see ETG 1000.6 specification). |
[out] | data | Data buffer for uploaded data. |
[in] | dataSize | Number of bytes in 'data' available to upload. |
[out] | dataSizeRet | Number of bytes used for upload. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Perform a CoE SDO upload from an EtherCAT slave device to the master.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatAddressType addressType = MLPI_ETHERCAT_AUTO_INCREMENT;
5 USHORT objectIndex = 4;
8 UCHAR data[1024] = {0};
9 ULONG dataSize = _countof(data);
10 ULONG dataSizeRet = 0;
11 for (subIndex = 1; subIndex <= 4; subIndex++)
13 result = mlpiEthercatCoeSdoUpload(connection, interfaceNumber, addressType, address, objectIndex, subIndex, flags, data, dataSize, &dataSizeRet);
This function performs a CoE SDO download from the master to an EtherCAT slave device.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | interfaceNumber | Master interface number. |
[in] | addressType | Address type. |
[in] | address | Slave address (depending on addressType). |
[in] | objectIndex | Object index. |
[in] | subIndex | Sub index. |
[in] | flags | Mailbox flags specifying the upload behavior. Bit 0: Complete Access, Bit 1-31: Reserved (see ETG 1000.6 specification). |
[in] | data | Data to be transferred. |
[in] | dataSize | Number of bytes in 'data' available to download. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Perform a CoE SDO download from the master to an EtherCAT slave device.
2 ULONG interfaceNumber = 0;
3 MlpiEthercatAddressType addressType = MLPI_ETHERCAT_AUTO_INCREMENT;
5 USHORT objectIndex = 0x4000;
8 UCHAR data[1024] = {0};
9 ULONG dataSize = _countof(data);
10 MLPIRESULT result = mlpiEthercatCoeSdoDownload(connection, interfaceNumber, addressType, address, objectIndex, subIndex, flags, data, dataSize);