1 #ifndef __MLPIETHERCATLIB_H__ 2 #define __MLPIETHERCATLIB_H__ 337 #define MLPI_ETHERCAT_MAX_ESC_PORTS ( 4 ) 340 #define MLPI_ETHERCAT_MAX_SLAVE_NAME_LEN ( 128 ) 343 #define MLPI_ETHERCAT_MAX_VENDOR_DATA_STRING_LEN ( 128 ) 346 #define MLPI_ETHERCAT_MAX_PROCESS_DATA_SECTIONS ( 4 ) 409 #if !defined(TARGET_OS_VXWORKS) 427 ULONG revisionNumber;
505 UCHAR portDescriptor;
513 ULONG systemTimeDifference;
515 ULONG propagationDelay;
562 USHORT previousEthercatAddr;
573 UCHAR portDescriptor;
579 BOOL8 isHcGroupPresent;
656 UCHAR ecatProcUnitErrorCounter;
657 UCHAR pdiErrorCounter;
677 #if !defined(TARGET_OS_VXWORKS) 692 #if defined(TARGET_OS_WINNT) 693 #if defined(MLPI_EXPORTS) 694 #define MLPI_API __declspec(dllexport) 695 #elif defined(MLPI_IMPORTS) 696 #define MLPI_API __declspec(dllimport) 701 #if defined(MLPI_EXPORTS) 702 #define MLPI_API __attribute__ ((visibility("default"))) 703 #elif defined(MLPI_IMPORTS) 1703 #endif // endof: #ifndef __MLPIETHERCATLIB_H__
struct MlpiEthercatIdentityInfo MlpiEthercatIdentityInfo
This structure containing slave information.
MLPIRESULT mlpiEthercatGetTopologyStatus(const MLPIHANDLE connection, const ULONG interfaceNumber, MlpiEthercatTopologyStatus *topologyStatus, ULONG *numChanges)
This function returns the status of topology detection.
unsigned char UCHAR
1 byte unsigned integer
struct MlpiEthercatSlaveStatistics MlpiEthercatSlaveStatistics
This structure defines the statistic information of an EtherCAT slave.
MLPIRESULT mlpiEthercatGetSlaveStatisticsPeriod(const MLPIHANDLE connection, const ULONG interfaceNumber, ULONG *periodMs)
This function returns the update period of internal slave statistics collection.
MLPIRESULT mlpiEthercatSetConfigFiles(const MLPIHANDLE connection, const ULONG interfaceNumber, const WCHAR16 *iniPathFileName, const WCHAR16 *eniPathFileName)
This function sets the master configuration (files will be loaded from local drive of control)...
MLPIRESULT mlpiEthercatSetSlaveStatisticsPeriod(const MLPIHANDLE connection, const ULONG interfaceNumber, const ULONG periodMs)
This function sets the update period of internal slave statistics collection.
MLPIRESULT mlpiEthercatGetConfigFiles(const MLPIHANDLE connection, const ULONG interfaceNumber, const WCHAR16 *iniPathFileName, const WCHAR16 *eniPathFileName)
This function returns the master configuration (files will be stored on local drive of control)...
MLPIRESULT mlpiEthercatGetProcessData(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatProcessDataType pdType, const ULONG offset, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet)
This function reads process data (consistent) and returns them as byte stream.
MLPIRESULT mlpiEthercatReadSlaveEeprom(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT eepromOffset, USHORT *data, const ULONG numElements, ULONG *numElementsRet)
This function reads data from the EEPROM of a specific device.
#define MLPI_ETHERCAT_MAX_VENDOR_DATA_STRING_LEN
Maximum number of slave ports.
MlpiEthercatState
This enumeration represents the specific states of the EtherCAT State Machine.
signed char BOOL8
1 byte boolean
unsigned short USHORT
2 byte unsigned integer
MLPIRESULT mlpiEthercatWriteSlaveRegister(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT registerOffset, UCHAR *data, const ULONG dataSize)
This function writes data into the EtherCAT Slave Controller memory of a specific device...
MLPIRESULT mlpiEthercatGetBusScanStatus(const MLPIHANDLE connection, const ULONG interfaceNumber, MLPIRESULT *status, ULONG *slaveCount)
This function returns the status of the bus scan.
Only startup parameter objects.
Only stored for a device replacement objects.
MlpiEthercatTopologyStatus
This enumeration indicates the status of topology detection.
MLPIRESULT mlpiEthercatGetNumConfiguredSlaves(const MLPIHANDLE connection, const ULONG interfaceNumber, ULONG *numSlaves)
This function returns the number of configured slaves.
MLPIRESULT mlpiEthercatSetProcessData(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatProcessDataType pdType, const ULONG offset, UCHAR *data, const ULONG dataSize)
This function writes byte stream to process data (consistent).
wchar_t WCHAR16
UTF16 string.
unsigned int ULONG
4 byte unsigned integer
struct MlpiEthercatSoeElementFlags MlpiEthercatSoeElementFlags
With this structure each element of an IDN can be addressed. The ElementFlags indicating which elemen...
MLPIRESULT mlpiEthercatGetBusScanSlaveInfo(const MLPIHANDLE connection, const ULONG interfaceNumber, const USHORT autoIncAddr, MlpiEthercatSlaveBusScanInfo *slaveBusScanInfo, const ULONG numElements, ULONG *numElementsRet)
This function returns the slave information collected during bus scan.
Topology detection still pending / in progress.
MLPIRESULT mlpiEthercatCoeGetOdList(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const MlpiEthercatOdListType listType, USHORT *indicies, const ULONG numElements, ULONG *numElementsRet)
This function gets a list of object indices which are available in a EtherCAT CoE device...
Only pdo mappable objects.
struct MlpiEthercatSlaveOnlineInfo MlpiEthercatSlaveOnlineInfo
This structure defines the slave online info and is used in mlpiEthercatGetSlaveOnlineInfo.
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)
This function performs a CoE SDO download from the master to an EtherCAT slave device.
MLPIRESULT mlpiEthercatWriteSlaveEeprom(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT eepromOffset, USHORT *data, const ULONG numElements)
This function writes data into the EEPROM of a specific device.
MLPIRESULT mlpiEthercatGetSlaveOnlineInfo(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, MlpiEthercatSlaveOnlineInfo *slaveOnlineInfo)
This function returns information about a slave connected to the EtherCAT bus.
MLPIRESULT mlpiEthercatGetProcessDataSize(const MLPIHANDLE connection, const ULONG interfaceNumber, ULONG *numOutputBytes, ULONG *numInputBytes)
This function returns the size of the current process data image, e.g. use for diagnosis purpose...
MLPIRESULT mlpiEthercatGenerateEsi(const MLPIHANDLE connection, const WCHAR16 *eepromPathFileName, const WCHAR16 *esiPathFileName, const ULONG flags)
This function generates an EtherCAT Slave Information (Device Description) from an EEPROM image...
MLPIRESULT mlpiEthercatSoeRead(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const UCHAR driveNumber, MlpiEthercatSoeElementFlags *elementFlags, const USHORT idn, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet)
This function reads Sercos parameters.
#define MLPI_ETHERCAT_MAX_ESC_PORTS
Maximum number of slave ports.
MLPIRESULT mlpiEthercatGetSlaveStatistics(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, MlpiEthercatSlaveStatistics *slaveStatistics)
This function returns the slave's statistics counter. Counter can be used to detect errors on Etherne...
MLPIRESULT mlpiEthercatGetMasterStatus(const MLPIHANDLE connection, const ULONG interfaceNumber, ULONG *status)
This function returns the master status.
Topology verified and valid (e.g. elements of MlpiEthercatSlaveOnlineInfo can be used for drawing bus...
Lengths of each list type.
MLPIRESULT mlpiEthercatGetSlaveState(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, USHORT *currentState, USHORT *requestedState)
This function returns the current and requested slave state.
MLPIRESULT mlpiEthercatGetMasterState(const MLPIHANDLE connection, const ULONG interfaceNumber, MlpiEthercatState *state)
This function returns the current master state.
MLPIRESULT mlpiEthercatControl(const MLPIHANDLE connection, const ULONG interfaceNumber, const ULONG command, UCHAR *dataIn, const ULONG dataSizeIn, UCHAR *dataOut, const ULONG dataSizeOut, ULONG *dataSizeOutRet)
This function enables raw data exchange with the EtherCAT master stack.
MLPIRESULT mlpiEthercatStartBusScan(const MLPIHANDLE connection, const ULONG interfaceNumber, const ULONG flags)
This function starts the bus scan procedure of the master.
MLPIRESULT mlpiEthercatReloadSlaveEeprom(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address)
This function causes a specific slave to reload its EEPROM values to ESC registers.
#define MLPI_ETHERCAT_MAX_SLAVE_NAME_LEN
Maximum number of slave ports.
MLPIRESULT mlpiEthercatSoeWrite(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const UCHAR driveNumber, MlpiEthercatSoeElementFlags *elementFlags, const USHORT idn, UCHAR *data, const ULONG dataSize)
This function writes Sercos parameters.
struct MlpiEthercatVendorData MlpiEthercatVendorData
This structure defines the information of the vendor of the EtherCAT master.
Only pdo mappable objects that can be changed.
MLPIRESULT mlpiEthercatGetVendorInfo(const MLPIHANDLE connection, const ULONG vendorId, MlpiEthercatVendorInfo *vendorInfo)
This function returns the vendor information which is connected to a specific vendor id...
MLPIRESULT mlpiEthercatAssignSlaveEeprom(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const BOOL8 slavePdiAccessEnable, const BOOL8 forceAssign)
This function assigns the slave EEPROM either to Slave PDI or EtherCAT Master.
MlpiEthercatAddressType
This enumeration specifies the mode of addressing.
MlpiEthercatProcessDataType
This enumeration specifies the type of process data.
MLPIRESULT mlpiEthercatGetSlavePortState(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, USHORT *portState)
This function returns the state of the slave ports.
struct MlpiEthercatMailboxInfo MlpiEthercatMailboxInfo
This structure containing mailbox information.
MLPIRESULT mlpiEthercatCheckSlaveEeprom(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, BOOL8 *slavePdiAccessActive)
This function checks if the slave EEPROM is marked for slave PDI access or not.
MLPIRESULT mlpiEthercatResetSlaveStatistics(const MLPIHANDLE connection, const ULONG interfaceNumber)
This function clears all error registers (statistics counter) in all slaves.
MLPIRESULT mlpiEthercatGetSlaveConfigInfo(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, MlpiEthercatSlaveConfigInfo *slaveConfigInfo)
This function returns information about a slave configured within the ENI file.
MLPIRESULT mlpiEthercatReadSlaveIdentification(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT ado, USHORT *value)
This function reads the identification value from a slave.
#define MLPI_ETHERCAT_MAX_PROCESS_DATA_SECTIONS
Maximum number of supported process data sections.
struct MlpiEthercatSlaveConfigInfo MlpiEthercatSlaveConfigInfo
This structure defines the the slave config info and is used in mlpiEthercatGetSlaveConfigInfo.
MLPIRESULT mlpiEthercatCoeGetObjectDescription(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT objectIndex, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet)
This function gets the object description for a specific object (SDO) in EtherCAT CoE device...
unsigned long MLPIHANDLE
common MLPI-API handle value
MLPIRESULT mlpiEthercatGetNumConnectedSlaves(const MLPIHANDLE connection, const ULONG interfaceNumber, ULONG *numSlaves)
This function returns the number of connected slaves.
MLPIRESULT mlpiEthercatReadSlaveRegister(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const USHORT registerOffset, UCHAR *data, const ULONG dataSize, ULONG *dataSizeRet)
This function reads data from the EtherCAT Slave Controller memory of a specific device.
MLPIRESULT mlpiEthercatSetMasterState(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatState state)
This function sets the a new master state.
struct MlpiEthercatVendorInfo MlpiEthercatVendorInfo
This structure defines the member and predecessor of the vendor.
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)
This function gets the object entry description for a specific object (SDO) in EtherCAT CoE device...
MLPIRESULT mlpiEthercatGetSlaveStatus(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, ULONG *status)
This function returns the slave status.
MLPIRESULT mlpiEthercatSetSlaveState(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address, const MlpiEthercatState slaveState)
This function sets a new slave state.
struct MlpiEthercatSlaveBusScanInfo MlpiEthercatSlaveBusScanInfo
This structure containing information (retrieved while bus scan) about a slave connected to the Ether...
struct MlpiEthercatMemoryInfo MlpiEthercatMemoryInfo
This structure describing a specific memory area.
int MLPIRESULT
common MLPI-API return value
MLPIRESULT mlpiEthercatResetSlaveController(const MLPIHANDLE connection, const ULONG interfaceNumber, const MlpiEthercatAddressType addressType, const USHORT address)
This function resets a ESC (e.g., ET1100, ET1200, and IP Core) if it is capable of issuing a hardware...
MlpiEthercatOdListType
This enumeration specifies the type of object dictionary list.
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)
This function performs a CoE SDO upload from an EtherCAT slave device to the master.