# 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 SubDevices. Possible use cases are: Optional SubDevices : ENI contains several optional SubDevices that can be excluded depending on their presence. Alternative SubDevices : ENI contains several different alternatives for a SubDevice at a certain position. According to the use case the application can exclude SubDevices from this superset. ## emonConfigLoad ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) emonConfigLoad([EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_CNF_TYPE](api_general.html.md#_CPPv413EC_T_CNF_TYPE) eCnfType, [EC_T_PBYTE](api.html.md#_CPPv410EC_T_PBYTE) pbyCnfData, [EC_T_DWORD](api.html.md#_CPPv410EC_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](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga8c8419c32e88e73d940a4501fe427116) if successful * [EC_E_INVALIDSTATE](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga2a6310e052fca1b94797e8e26f031739) if EtherCAT stack isn’t initialized * [EC_E_INVALIDPARM](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga1e10d9022db11a708658c71b0dead2fe) if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer * [EC_E_NOMEMORY](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga48c2a7b288dc6922a8c0eb116495e1fd) if some memory cannot be allocated * [EC_E_ADS_IS_RUNNING](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1gac053cb32c9b2bee0305b0644ef76e933) if the ADS server is running ### enum [EC_T_CNF_TYPE](api_general.html.md#_CPPv413EC_T_CNF_TYPE) ### enumerator [eCnfType_Unknown](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE16eCnfType_UnknownE) ### enumerator [eCnfType_Filename](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE17eCnfType_FilenameE) ### enumerator [eCnfType_Data](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE13eCnfType_DataE) ### enumerator [eCnfType_Datadiag](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE17eCnfType_DatadiagE) ### enumerator [eCnfType_GenPreopENI](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE20eCnfType_GenPreopENIE) ### enumerator [eCnfType_GenPreopENIWithCRC](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE27eCnfType_GenPreopENIWithCRCE) ### enumerator [eCnfType_GenOpENI](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE17eCnfType_GenOpENIE) ### enumerator [eCnfType_None](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE13eCnfType_NoneE) ### enumerator [eCnfType_ConfigData](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE19eCnfType_ConfigDataE) ### enumerator [eCnfType_GenOpENINoStrings](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE26eCnfType_GenOpENINoStringsE) ### enumerator [eCnfType_FileByApp](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE18eCnfType_FileByAppE) ### enumerator [eCnfType_GenEBI](api_general.html.md#_CPPv4N13EC_T_CNF_TYPE15eCnfType_GenEBIE) ## emonConfigExcludeSlave ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) emonConfigExcludeSlave([EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_WORD](api.html.md#_CPPv49EC_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](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga8c8419c32e88e73d940a4501fe427116) or error code ## emonConfigIncludeSlave ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) emonConfigIncludeSlave([EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_WORD](api.html.md#_CPPv49EC_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](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga8c8419c32e88e73d940a4501fe427116) or error code ## emonConfigSetPreviousPort ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) emonConfigSetPreviousPort([EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) wStationAddress, [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) wStationAddressPrev, [EC_T_WORD](api.html.md#_CPPv49EC_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](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga8c8419c32e88e73d940a4501fe427116) or error code ## emonConfigApply ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) emonConfigApply([EC_T_DWORD](api.html.md#_CPPv410EC_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](error-codes_generic.html.md#d3/d2f/group___e_c___e_r_r_o_r___c_o_d_e_s___g_e_n_e_r_i_c_1ga8c8419c32e88e73d940a4501fe427116) or error code