9.11. Configuration adjustments
The Configuration adjustments allows to adapt the configuration without generating a new ENI file. The base ENI file contains a superset of all the possible connected slaves. Possible use cases are:
- Optional Slaves
ENI contains several optional slaves that can be excluded depending on their presence.
- Alternative Slaves
ENI contains several different alternatives for a slave at a certain position.
According to the use case the application can exclude slaves from this superset.
9.11.1. emonConfigLoad
-
EC_T_DWORD emonConfigLoad(EC_T_DWORD dwInstanceID, EC_T_CNF_TYPE eCnfType, EC_T_PBYTE pbyCnfData, EC_T_DWORD dwCnfDataLen)
Load the network configuration.
In combination with emConfigApply, this function replaces emConfigureNetwork and must be called after the initialization. Among others the EtherCAT topology defined in the given XML configuration file will be stored internally.
Note
A client must not be registered prior to calling this function. Existing client registrations will be dropped.
- Parameters
dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)
eCnfType – [in] Type of configuration data provided
pbyCnfData – [in] Configuration data
dwCnfDataLen – [in] Length of configuration data in byte
- Returns
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if master isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer
EC_E_NOMEMORY if some memory cannot be allocated
EC_E_ADS_IS_RUNNING if ADS server is running
-
enum EC_T_CNF_TYPE
-
enumerator eCnfType_Unknown
-
enumerator eCnfType_Filename
-
enumerator eCnfType_Data
-
enumerator eCnfType_Datadiag
-
enumerator eCnfType_GenPreopENI
-
enumerator eCnfType_GenPreopENIWithCRC
-
enumerator eCnfType_GenOpENI
-
enumerator eCnfType_None
-
enumerator eCnfType_ConfigData
-
enumerator eCnfType_GenOpENINoStrings
-
enumerator eCnfType_FileByApp
-
enumerator eCnfType_Unknown
9.11.2. emonConfigExcludeSlave
-
EC_T_DWORD emonConfigExcludeSlave(EC_T_DWORD dwInstanceID, EC_T_WORD wStationAddress)
Exclude a slave from the network configuration.
It has to be called after emConfigLoad and prior to calling emConfigApply.
- Parameters
dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)
wStationAddress – [in] Station address of the slave to be excluded. A value of 0 excludes all slaves.
- Returns
EC_E_NOERROR or error code
9.11.3. emonConfigIncludeSlave
-
EC_T_DWORD emonConfigIncludeSlave(EC_T_DWORD dwInstanceID, EC_T_WORD wStationAddress)
Include a slave in the network configuration.
Slaves that were previously excluded with emConfigSlaveExclude can be added again. It has to be called after emConfigLoad and prior to calling emConfigApply.
- Parameters
dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)
wStationAddress – [in] Station address of the slave to be included. A value of 0 includes all slaves.
- Returns
EC_E_NOERROR or error code
9.11.4. emonConfigSetPreviousPort
-
EC_T_DWORD emonConfigSetPreviousPort(EC_T_DWORD dwInstanceID, EC_T_WORD wStationAddress, EC_T_WORD wStationAddressPrev, EC_T_WORD wPortPrev)
Set previous port information of a slave.
It has to be called after emConfigLoad and prior to calling emConfigApply.
- Parameters
dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)
wStationAddress – [in] Station address of the slave
wStationAddressPrev – [in] Previous slave station address
wPortPrev – [in] Previous port
- Returns
EC_E_NOERROR or error code
9.11.5. emonConfigApply
-
EC_T_DWORD emonConfigApply(EC_T_DWORD dwInstanceID)
Apply the network configuration.
It has to be called after emConfigLoad.
- Parameters
dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)
- Returns
EC_E_NOERROR or error code