# General functions
## emInitMaster
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatInitMaster(const [EC_T_INIT_MASTER_PARMS](#_CPPv422EC_T_INIT_MASTER_PARMS) \*pParms)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emInitMaster([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, const [EC_T_INIT_MASTER_PARMS](#_CPPv422EC_T_INIT_MASTER_PARMS) \*pParms)
Initialize EC-Master.
This function has to be called prior to calling any other function of EC-Master.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pParms** – [in] Pointer to parameter definitions
* **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 is already 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 or pParms is EC_NULL or contains some values out of range
* [EC_E_SIGNATURE_MISMATCH](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_1gac700561c04c9d81a7c088e13d104cf36) if [EC_T_INIT_MASTER_PARMS.dwSignature](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1af0642e281f06ad3914f05c31b1cc311e) mismatch
* [EC_E_NOTFOUND](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_1ga3113f3b6f82bb50e6ab3cde40268730a) if the link layer cannot be found
* [EC_E_FEATURE_DISABLED](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_1gab1113b4cdd40bec6cddbd07d8780ff8a) if a configured feature is not included in the license key
* [EC_E_NOTSUPPORTED](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_1ga11f77305fb1d3868539a735298cc7864) if a configured feature is not supported (e.g not compiled in the library)
* [EC_E_LOCK_CREATE_FAILED](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_1ga1f28e665d82dadd8fd062e38ee7b4ea0) if some lock (e.g mutex) cannot be created
* [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
### struct EC_T_INIT_MASTER_PARMS
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSignature
[in] Set to ATECAT_SIGNATURE
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSize
[in] Set to sizeof(EC_T_INIT_MASTER_PARMS)
### [EC_T_LOG_PARMS](#_CPPv414EC_T_LOG_PARMS) LogParms
[in] Logging parameters
### [EC_T_OS_PARMS](#_CPPv413EC_T_OS_PARMS) \*pOsParms
[in] OS layer parameters
### [EC_T_LINK_PARMS](emll_init.html.md#_CPPv415EC_T_LINK_PARMS) \*pLinkParms
[in] Link layer parameters
### [EC_T_LINK_PARMS](emll_init.html.md#_CPPv415EC_T_LINK_PARMS) \*pLinkParmsRed
[in] Link layer parameters for red device (cable redundancy)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwBusCycleTimeNsec
[in] Bus cycle time [ns]
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxBusSlaves
[in] Maximum pre-allocated bus slave objects ( default: 256 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxAcycFramesQueued
[in] Maximum queued acyclic frames
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwAdditionalEoEEndpoints
[in] Additional EoE endpoints
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxAcycBytesPerCycle
[in] Maximum bytes sent during eUsrJob_SendAcycFrames per cycle ( default: 4096 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxAcycFramesPerCycle
[in] Maximum frames sent during eUsrJob_SendAcycFrames per cycle ( default: 32 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxAcycCmdsPerCycle
[in] Maximum commands sent during eUsrJob_SendAcycFrames per cycle ( default: 124 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxSlavesProcessedPerCycle
[in] Maximum slave-related state machine calls per cycle (default = all)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwEcatCmdMaxRetries
[in] Maximum retries to send pending EtherCAT command frames ( default: 3 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwEcatCmdTimeout
[in] Timeout [ms] to send pending EtherCAT command frames ( default: 3 \* bus cycle time, at least 2 ms )
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bReserved
[in] bVLANEnable: obsolete
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wReserved
[in] wVLANId: obsolete
### [EC_T_BYTE](toc_api.html.md#_CPPv49EC_T_BYTE) byReserved
[in] byVLANPrio: obsolete
### EC_T_MASTER_RED_PARMS MasterRedParms
[in] Master Redundancy parameters
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxS2SMbxSize
[in] Size of the queued S2S mailbox in bytes ( default: 0 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxQueuedS2SMbxTfer
[in] S2S Fifo number of entries ( default: 0 )
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wMaxSlavesProcessedPerBusScanStep
[in] Maximum slave-related calls per cycle during bus scans (default = all)
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bApiLockByApp
[in] Lock pending API against [emDeinitMaster()](#db/d74/_ec_master_api_8cpp_1a5e90f588405100ab8fb8ff552982ae18). EC_FALSE (default): locked internally. EC_TRUE: application is responsible for locking.
### [EC_T_PERF_MEAS_INTERNAL_PARMS](#_CPPv429EC_T_PERF_MEAS_INTERNAL_PARMS) PerfMeasInternalParms
[in] Internal performance measurement parameters
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bNoConsecutiveAcycFrames
[in] [EC_FALSE(default)](toc_api.html.md#d3/d07/_ec_type_8h_1a149503ff82608125e305c77d12d46d1b) : no restriction. EC_TRUE : Don’t process and send acyclic frames in the same cycle to reduce CPU load.
### struct EC_T_OS_PARMS
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSignature
[in] Set to EC_OS_PARMS_SIGNATURE
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSize
[in] Set to sizeof(EC_T_OS_PARMS)
### [EC_T_LOG_PARMS](#_CPPv414EC_T_LOG_PARMS) \*pLogParms
[in] Pointer to logging parameters
### EC_PF_SYSTIME pfSystemTimeGet
[in] Function to get host time in nanoseconds since 1st January 2000. Used as time base for DC Initialization.
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSupportedFeatures
[in/out] Reserved
### EC_PF_QUERY_MSEC_COUNT pfSystemQueryMsecCount
[in] Function to get system’s ms count
### struct EC_T_LOG_PARMS
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwLogLevel
[in] Log level. See [EC_LOG_LEVEL…](#d3-d63-group-e-c-l-o-g-l-e-v-e-l-s)
### [EC_PF_LOGMSGHK](#_CPPv414EC_PF_LOGMSGHK) pfLogMsg
[in] Log callback function called on every message
### EC_T_LOG_CONTEXT \*pLogContext
[in] Log context to be passed to log callback
EC_LOG_LEVEL…
The following log levels are defined:
### EC_LOG_LEVEL_SILENT
### EC_LOG_LEVEL_ANY
### EC_LOG_LEVEL_CRITICAL
### EC_LOG_LEVEL_ERROR
### EC_LOG_LEVEL_WARNING
### EC_LOG_LEVEL_INFO
### EC_LOG_LEVEL_INFO_API
### EC_LOG_LEVEL_VERBOSE
### EC_LOG_LEVEL_VERBOSE_ACYC
### EC_LOG_LEVEL_VERBOSE_CYC
### EC_LOG_LEVEL_UNDEFINED
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_LOGMSGHK)(EC_T_LOG_CONTEXT \*pContext, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwLogMsgSeverity, const [EC_T_CHAR](toc_api.html.md#_CPPv49EC_T_CHAR) \*szFormat, ...)
* **Param pContext:**
[in] Context pointer. This pointer is used as parameter when the callback function is called.
* **Param dwLogMsgSeverity:**
[in] Log message severity, EC_LOG_LEVEL_…
* **Param szFormat:**
[in] String that contains the text to be written. It can optionally contain embedded format specifiers that are replaced by the values specified in subsequent additional arguments and formatted as requested.
* **Return:**
[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
Log messages are passed from the EC-Master to the callback given at [`EC_T_LOG_PARMS::pfLogMsg`](#_CPPv4N14EC_T_LOG_PARMS8pfLogMsgE). EcLogging.cpp demonstrates how messages can be handled by the application.
For performance reasons the EC-Master automatically filters log messages according to [`EC_T_LOG_PARMS::dwLogLevel`](#_CPPv4N14EC_T_LOG_PARMS10dwLogLevelE). E.g. messages of severity [`EC_LOG_LEVEL_WARNING`](#c.EC_LOG_LEVEL_WARNING) are not passed to the application if [`EC_T_LOG_PARMS::dwLogLevel`](#_CPPv4N14EC_T_LOG_PARMS10dwLogLevelE) is set to [`EC_LOG_LEVEL_ERROR`](#c.EC_LOG_LEVEL_ERROR).
The application can provide customized log message handlers of type [`EC_PF_LOGMSGHK`](#_CPPv414EC_PF_LOGMSGHK) if the default handler in EcLogging.cpp does not fulfill the application’s needs. Note: The callback is typically called from the Job Task’s context and should return as fast as possible.
### struct EC_T_PERF_MEAS_INTERNAL_PARMS
### Public Members
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bEnabled
[in] Enable/disable internal performance counters
### [EC_T_PERF_MEAS_COUNTER_PARMS](#_CPPv428EC_T_PERF_MEAS_COUNTER_PARMS) CounterParms
[in] Timer function settings. When not provided OsMeasGetCounterTicks is used.
### [EC_T_PERF_MEAS_HISTOGRAM_PARMS](#_CPPv430EC_T_PERF_MEAS_HISTOGRAM_PARMS) HistogramParms
[in] Histogram settings. When not provided the histogram is disabled.
### struct EC_T_PERF_MEAS_COUNTER_PARMS
### Public Members
### [EC_PF_PERF_MEAS_GETCOUNTERTICKS](#_CPPv431EC_PF_PERF_MEAS_GETCOUNTERTICKS) pfGetCounterTicks
[in] Function returning the current counter ticks
### EC_T_VOID \*pvGetCounterTicksContext
[in] Context passed into GetCounterTicks
### EC_T_UINT64 qwFrequency
[in] Frequency in Hz used by the timer in GetCounterTicks
### typedef EC_T_UINT64 (\*EC_PF_PERF_MEAS_GETCOUNTERTICKS)(EC_T_VOID \*pvContext)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
### struct EC_T_PERF_MEAS_HISTOGRAM_PARMS
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwBinCount
[in] Amount of bins to use for the histogram
### EC_T_UINT64 qwMinTicks
[in] Results below qwMinTicks are stored in the first bin
### EC_T_UINT64 qwMaxTicks
[in] Results above qwMaxTicks are stored in the last bin
## emDeinitMaster
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatDeinitMaster(EC_T_VOID)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emDeinitMaster([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID)
Deinitialize EC-Master.
Waits for pending API calls if [emInitMaster()](#db/d74/_ec_master_api_8cpp_1a20396c6311952930b2a5c10c2baf2131) was called with [EC_T_INIT_MASTER_PARMS::bApiLockByApp](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1a547ddca9ee542c4373ddbb2adc436fc3) = EC_FALSE (default).
* **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
## emGetMasterParms
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatGetMasterParms([EC_T_INIT_MASTER_PARMS](#_CPPv422EC_T_INIT_MASTER_PARMS) \*pParms, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwParmsBufSize)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emGetMasterParms([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_INIT_MASTER_PARMS](#_CPPv422EC_T_INIT_MASTER_PARMS) \*pParms, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwParmsBufSize)
Get current Master initialization parameters.
If the given buffer is larger than the actual size of the structure [EC_T_INIT_MASTER_PARMS](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s), the parameters of [EC_T_INIT_MASTER_PARMS.pOsParms](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1ab6f3eca95a1ef491d761cb66b882dd8b), [EC_T_INIT_MASTER_PARMS.pLinkParms](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1a7391b4950b7bc41ae8000ace06400d64) and [EC_T_INIT_MASTER_PARMS.pLinkParmsRed](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1aeb5abd3b1c6fcce37d7c667100ccc644) are appended.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pParms** – [out] Buffer to store Master parameters
* **dwParmsBufSize** – [in] Size of Master parameters buffer
* **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 or the output pointer is EC_NULL or dwParmsBufSize is too small
### **emGetMasterParms() Example**
```cpp
EC_T_BYTE abyBuffer[sizeof(EC_T_INIT_MASTER_PARMS)
+ sizeof(EC_T_OS_PARMS) + 512 /* LinkLayer parameters */];
EC_T_INIT_MASTER_PARMS* pParms = (EC_T_INIT_MASTER_PARMS*)abyBuffer;
dwRes = emGetMasterParms(dwInstanceId, pParms, sizeof(abyBuffer));
```
#### SEE ALSO
[`emInitMaster()`](#_CPPv412emInitMaster10EC_T_DWORDPK22EC_T_INIT_MASTER_PARMS)
## emSetMasterParms
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatSetMasterParms(const [EC_T_INIT_MASTER_PARMS](#_CPPv422EC_T_INIT_MASTER_PARMS) \*pParms)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emSetMasterParms([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, const [EC_T_INIT_MASTER_PARMS](#_CPPv422EC_T_INIT_MASTER_PARMS) \*pParms)
Change Master initialization parameters.
Currently the following parameters cannot be changed:
* [EC_T_INIT_MASTER_PARMS.pOsParms](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1ab6f3eca95a1ef491d761cb66b882dd8b)
* [EC_T_INIT_MASTER_PARMS.pLinkParms](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1a7391b4950b7bc41ae8000ace06400d64)
* [EC_T_INIT_MASTER_PARMS.pLinkParmsRed](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1aeb5abd3b1c6fcce37d7c667100ccc644)
* [EC_T_INIT_MASTER_PARMS.dwMaxBusSlaves](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1a26c3f1f2a5c46af4ad8cc8aa955cebb8)
* [EC_T_INIT_MASTER_PARMS.dwMaxAcycFramesQueued](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1ae90efbf60aa12acbd95ab39a3f0b10a0)
* [EC_T_INIT_MASTER_PARMS.dwAdditionalEoEEndpoints](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1aba26f467698dcc9d3a69545512918300)
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pParms** – [in] New Master parameters
* **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
### **emSetMasterParms() Example**
```cpp
EC_T_BYTE abyBuffer[sizeof(EC_T_INIT_MASTER_PARMS) + sizeof(EC_T_OS_PARMS)
+ 512 /* LinkLayer parameters */];
EC_T_INIT_MASTER_PARMS* pParms = (EC_T_INIT_MASTER_PARMS*)abyBuffer;
dwRes = emGetMasterParms(dwInstanceId, pParms, sizeof(abyBuffer));
pParms->wReserved = 1;
/* change Master initialization parameters */
dwRes = emSetMasterParms(dwInstanceId, pParms);
```
#### SEE ALSO
[`emInitMaster()`](#_CPPv412emInitMaster10EC_T_DWORDPK22EC_T_INIT_MASTER_PARMS)
## emScanBus
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatScanBus([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emScanBus([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout)
Scans all connected slaves.
Scans all connected slaves connected to EC-Master. If a configuration has been loaded, a validation between the configuration and the connected slaves is done. This function should not be called from within the JobTask’s context.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **dwTimeout** – [in] Timeout [ms]
* **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
* [EC_E_LINK_DISCONNECTED](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_1ga8dac899f16df522b9c6754c7d8d0fb72) if link is disconnected
* [EC_E_TIMEOUT](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_1ga2d09527654c655e159d26d36143674cb) if dwTimeout elapsed during the API call
* [EC_E_BUSCONFIG_MISMATCH](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_1ga613dd4e3b8cac7ac5193993f1afeaae6) if the slaves found do not match the configured ones
* [EC_E_LINE_CROSSED](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_1ga83c05b7bdc82fe8c2b664fae4156b995) if a line crossed (cabling wrong) condition has been detected
* [EC_E_REDLINEBREAK](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_1gaccf988b91722079a5b6be82dc2e0beec) if cable redundancy is configured and a line break condition has been detected
* [EC_E_JUNCTION_RED_LINE_BREAK](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_1gaa5458e142909815b607221dda2bb018e) if junction redundancy is configured and a line break condition has been detected
* [EC_E_MAX_BUS_SLAVES_EXCEEDED](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_1ga0cc0e975f6f44f48a70ac7c9eedfd331) if the amount of slaves found exceeds [EC_T_INIT_MASTER_PARMS.dwMaxBusSlaves](#dc/dcc/struct_e_c___t___i_n_i_t___m_a_s_t_e_r___p_a_r_m_s_1a26c3f1f2a5c46af4ad8cc8aa955cebb8)
* [EC_E_MASTER_RED_STATE_INACTIVE](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_1gae2870f20d370920995e27b2a78171a5e) if Master Redundancy is configured and master is inactive
* [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
### **emScanBus() Example**
```cpp
dwRes = emScanBus(dwInstanceId, 5000 /* timeout */);
```
#### SEE ALSO
- [EtherCAT® Bus Scan](api_busscan.html.md#ethercat-r-bus-scan)
## emRescueScan
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatRescueScan([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emRescueScan([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout)
Recovers the bus from permanent frame loss situations.
Scans all connected slaves. Closes and opens ports on the network to rule out slaves which permanently discard frames. The Master notifies every slave port which permanently discards frames with EC_NOTIFY_FRAMELOSS_AFTER_SLAVE. Due to port opening and closing the scanning time is increased about 2 seconds per slave. The Master will not automatically re-open this port. The application can force to open the port again. This function may not be called from within the JobTask’s context.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **dwTimeout** – [in] Timeout [ms]
* **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
### **emRescueScan() Example**
```cpp
dwRes = emRescueScan(dwInstanceId, 5000 /* timeout */);
```
#### SEE ALSO
- [`emSetSlavePortState()`](api_slave_control.html.md#_CPPv419emSetSlavePortState10EC_T_DWORD10EC_T_DWORD9EC_T_WORD9EC_T_BOOL9EC_T_BOOL10EC_T_DWORD)
- [emNotify - EC_NOTIFY_FRAMELOSS_AFTER_SLAVE](api_busscan.html.md#emnotify-ec-notify-frameloss-after-slave)
## emConfigureNetwork
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatConfigureNetwork([EC_T_CNF_TYPE](#_CPPv413EC_T_CNF_TYPE) eCnfType, [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) pbyCnfData, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwCnfDataLen)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emConfigureNetwork([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_CNF_TYPE](#_CPPv413EC_T_CNF_TYPE) eCnfType, [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) pbyCnfData, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwCnfDataLen)
Configure the Network.
This function must be called after the initialization. Among others the EtherCAT topology defined in the given XML configuration file will be stored internally.
Analyzing the network including mailbox communication can be done without specifying an ENI file using eCnfType_GenPreopENI.
#### 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] Filename / configuration data, or EC_NULL if eCnfType is eCnfType_GenPreopENI
* **dwCnfDataLen** – [in] Length of configuration data in byte, or zero if eCnfType is eCnfType_GenPreopENI
* **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 or eCnfType is eCnfType_GenPreopENI or eCnfType_GenOpENI and link is disconnected
* [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 or pParms is EC_NULL contains some values out of range
* [EC_E_LINK_DISCONNECTED](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_1ga8dac899f16df522b9c6754c7d8d0fb72) if link is disconnected
* [EC_E_FEATURE_DISABLED](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_1gab1113b4cdd40bec6cddbd07d8780ff8a) if a configured feature is not included in the license key
* [EC_E_NOTSUPPORTED](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_1ga11f77305fb1d3868539a735298cc7864) if a configured feature is not supported (e.g not compiled in the library)
* [EC_E_CFGFILENOTFOUND](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_1ga7da2ce5dd71f5dbc9c5b37ced65de133) if the ENI file cannot be found
* [EC_E_WRONG_FORMAT](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_1ga7ef775b882e22c0ac3ff95e8f0b5fb53) if format errors have been detected in the ENI or EEPROM in case of eCnfType_GenPreopENI or eCnfType_GenOpENI
* [EC_E_OEM_SIGNATURE_MISMATCH](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_1gaa9c0e78be6f5d34aa079232c84a9f796) if the OEM signature in the ENI file doesn’t match the used OEM key
* [EC_E_ENI_ENCRYPTION_WRONG_VERSION](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_1ga5c1f9e38352dc3ac3d458c30be5fa064) if the ENI encryption version is not supported (e.g. the library is too old)
* [EC_E_ENI_ENCRYPTED](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_1gae95f45d1e8937074725ff7fe77cbaf12) if the ENI is encrypted and no OEM key has been set
* [EC_E_XML_CYCCMDS_MISSING](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_1gaefee0a6b4f7097cc1ccdab22e2efccca) if the ENI doesn’t contain cyclic commands
* [EC_E_XML_ALSTATUS_READ_MISSING](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_1ga570d575d0d3bf5ee8e3a11cdd9e09eb2) if the ENI doesn’t contain any read AL status command
* [EC_E_XML_CYCCMDS_SIZEMISMATCH](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_1ga057e7cdfe426e792a7ab60830d2b3cf7) if the size of the cyclic commands in the ENI mismatch
* [EC_E_XML_INVALID_INP_OFF](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_1ga26f2972ae26bb55a653adbb40a8fefa0) if some input offsets in the ENI are invalid
* [EC_E_XML_INVALID_OUT_OFF](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_1gad32f71e9d681cba85774d28f4416ee00) if some output offsets in the ENI are invalid
* [EC_E_XML_INVALID_CMD_WITH_RED](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_1ga6bdb2349373a8e935d23521806c4462b) if the ENI contains LRW commands and cable redundancy is configured
* [EC_E_XML_PREV_PORT_MISSING](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_1ga9ad1388e4ca96dcc4cef15851b09b654) if some previous port information are missing in the ENI
* [EC_E_XML_DC_CYCCMDS_MISSING](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_1ga6aa2d4a50dde9e285f7c0f936edbb1d0) if the DC related cyclic commands are missing in the ENI
* [EC_E_XML_AOE_NETID_INVALID](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_1ga11c2ea29d41ed1e850c4c0e76a0f3b89) if the ENI contains some invalid NetID
### enum EC_T_CNF_TYPE
*Values:*
### enumerator eCnfType_Unknown
### enumerator eCnfType_Filename
pbyCnfData: ENI filename to read
### enumerator eCnfType_Data
pbyCnfData: ENI data
### enumerator eCnfType_Datadiag
pbyCnfData: ENI data for diagnosis
### enumerator eCnfType_GenPreopENI
Generate ENI based on bus-scan result to get into PREOP state
### enumerator eCnfType_GenPreopENIWithCRC
Same as eCnfType_GenPreopENI with CRC protection
### enumerator eCnfType_GenOpENI
Generate ENI based on bus-scan result to get into OP state. The default PDO mapping read from the slaves is activated. See ETG2010 “SII Specification”, Table 14 “Structure Category TXPDO and RXPDO for each PDO”.
### enumerator eCnfType_None
Reset configuration
### enumerator eCnfType_ConfigData
pbyCnfData: Binary structured configuration
### enumerator eCnfType_GenOpENINoStrings
Generate ENI based on bus-scan result to get into OP state, does not read strings from EEPROM
### enumerator eCnfType_FileByApp
File access provided by user application, See [EC_T_CNF_FILEBYAPP_DESC](#d0/d80/struct_e_c___t___c_n_f___f_i_l_e_b_y_a_p_p___d_e_s_c)
### enumerator eCnfType_GenEBI
Generate EBI based on bus-scan result
Depending on this enum pbyCnfData is interpreted differently. This function may not be called from within the JobTask’s context.
### struct EC_T_CNF_FILEBYAPP_DESC
### Public Members
### EC_T_VOID \*pvContext
[in] Arbitrarily application-defined parameter passed to callbacks
### [EC_PF_CNF_OPEN](#_CPPv414EC_PF_CNF_OPEN) pfnFileOpen
[in] Function pointer called instead of OsCfgFileOpen()
### [EC_PF_CNF_CLOSE](#_CPPv415EC_PF_CNF_CLOSE) pfnFileClose
[in] Function pointer called instead of OsCfgFileClose()
### [EC_PF_CNF_READ](#_CPPv414EC_PF_CNF_READ) pfnFileRead
[in] Function pointer called instead of OsCfgFileRead()
### [EC_PF_CNF_ERROR](#_CPPv415EC_PF_CNF_ERROR) pfnFileError
[in] Function pointer called instead of OsCfgFileError()
### [EC_PF_CNF_EOF](#_CPPv413EC_PF_CNF_EOF) pfnFileEof
[in] Function pointer called instead of OsCfgFileEof()
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_CNF_OPEN)(EC_T_VOID \*pvContext)
Called by the EtherCAT stack instead of OsCfgFileOpen() within emConfigureNetwork(eCnfType_FileByApp)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Return:**
[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
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_CNF_CLOSE)(EC_T_VOID \*pvContext)
Called by the EtherCAT stack instead of OsCfgFileClose() within emConfigureNetwork(eCnfType_FileByApp)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Return:**
[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
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_CNF_READ)(EC_T_VOID \*pvContext, [EC_T_BYTE](toc_api.html.md#_CPPv49EC_T_BYTE) \*pbyReadData, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwReadLen, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwNumOutData)
Called by the EtherCAT stack instead of OsCfgFileRead() within emConfigureNetwork(eCnfType_FileByApp)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Param pbyReadData:**
**[out]** Pointer to the data read
* **Param dwReadLen:**
**[in]** Amount of bytes to be read by the EtherCAT stack (next part of the configuration file)
* **Param pdwNumOutData:**
**[out]** Amount of bytes written to pbyReadData by callback
* **Return:**
[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
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_CNF_ERROR)(EC_T_VOID \*pvContext)
Called by the EtherCAT stack instead of OsCfgFileError() within emConfigureNetwork(eCnfType_FileByApp)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Return:**
[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
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_CNF_EOF)(EC_T_VOID \*pvContext, [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) \*bEof)
Called by the EtherCAT stack instead of OsCfgFileEof() within emConfigureNetwork(eCnfType_FileByApp)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Param bEof:**
**[out]** Indicates whether the end of the file has been reached (EC_TRUE if EOF, EC_FALSE otherwise).
* **Return:**
[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
### **emConfigureNetwork() Example**
```cpp
/* load ENI */
const EC_T_CHAR* szFileName = "eni.xml";
dwRes = emConfigureNetwork(dwInstanceId, eCnfType_Filename,
(EC_T_BYTE*)szFileName, (EC_T_DWORD)OsStrlen(szFileName));
```
## emConfigGet
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatConfigGet([EC_T_BYTE](toc_api.html.md#_CPPv49EC_T_BYTE) \*\*ppbyCnfData, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwCnfDataLen)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emConfigGet([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_BYTE](toc_api.html.md#_CPPv49EC_T_BYTE) \*\*ppbyCnfData, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwCnfDataLen)
Get the master configuration.
This function returns the result of ENI parsing in binary format. This data can be stored at a different location (e.g. read only flash). Later on, the Master can be configured without ENI using the type EC_T_CNF_TYPE::eCnfType_ConfigData.
#### NOTE
The binary format is not version independent and the data becomes invalid when used with a different version. The returned pointer is valid as long as the Master is initialized and no other configuration was loaded.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **ppbyCnfData** – [out] Configuration data
* **pdwCnfDataLen** – [out] 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) or error code
### **emConfigGet() Example**
```cpp
EC_T_BYTE* pbyConfigData = EC_NULL;
EC_T_DWORD dwConfigDataSize = 0;
/* set config data memory pool */
EC_IOCTL_SET_CONFIGDATA_MEMORY_POOL_DESC oPoolDesc;
oPoolDesc.dwSize = 100000; /* max config file size */
oPoolDesc.pbyStart = (EC_T_BYTE*)OsMalloc(oPoolDesc.dwSize);
dwRes = emIoCtl(dwInstanceId, EC_IOCTL_SET_CONFIGDATA_MEMORY_POOL,
&oPoolDesc, sizeof(EC_IOCTL_SET_CONFIGDATA_MEMORY_POOL_DESC),
EC_NULL, 0, EC_NULL);
if (dwRes != EC_E_NOERROR)
{
dwRetVal = dwRes;
goto Exit;
}
/* load config */
dwRes = emConfigLoad(dwInstanceId, eCnfType_Filename,
(EC_T_BYTE*)szFileName, (EC_T_DWORD)OsStrlen(szFileName));
if (dwRes != EC_E_NOERROR)
{
dwRetVal = dwRes;
goto Exit;
}
/* get config */
dwRes = emConfigGet(dwInstanceId, &pbyConfigData, &dwConfigDataSize);
if (dwRes != EC_E_NOERROR)
{
dwRetVal = dwRes;
goto Exit;
}
```
#### SEE ALSO
[`emConfigureNetwork()`](#_CPPv418emConfigureNetwork10EC_T_DWORD13EC_T_CNF_TYPE10EC_T_PBYTE10EC_T_DWORD)
## emConfigExtend
#### WARNING
Before using this function, please check if the following patents have to be taken into consideration for your application and use case:
**JP5212509:ADDRESS SETTING METHOD IN NETWORK SYSTEM**
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatConfigExtend([EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bResetConfig, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emConfigExtend([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bResetConfig, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout)
Extends the existing network configuration.
This function extends the existing configuration described in the ENI to allow mailbox communication with unexpected slaves. After this function was called, unexpected slaves can reach PREOP state. After the configuration was extended, disconnecting any slave will generate a bus mismatch, because all the slaves are part of the configuration. Recalling this function with bResetConfig set to EC_FALSE will extend the configuration again by any new connected unexpected slaves. The previous extension is not deleted. Calling the function with bResetConfig set to EC_TRUE will reset all the previous extensions.
#### NOTE
This function may not be called from within the JobTask’s context.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **bResetConfig** – [in] EC_TRUE: Extended configuration will be removed
* **dwTimeout** – [in] Timeout [ms]
* **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
### **emConfigExtend() Example**
```cpp
dwRes = emConfigExtend(dwInstanceId, EC_TRUE, 5000 /* timeout */);
```
## emRegisterClient
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatRegisterClient([EC_PF_NOTIFY](#_CPPv412EC_PF_NOTIFY) pfnNotify, EC_T_VOID \*pCallerData, [EC_T_REGISTERRESULTS](#_CPPv420EC_T_REGISTERRESULTS) \*pRegResults)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emRegisterClient([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_PF_NOTIFY](#_CPPv412EC_PF_NOTIFY) pfnNotify, EC_T_VOID \*pCallerData, [EC_T_REGISTERRESULTS](#_CPPv420EC_T_REGISTERRESULTS) \*pRegResults)
Registers a client on the EC-Master.
It must be called after configuration, otherwise the registration handle is lost. This function may not be called from within the JobTask’s context.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pfnNotify** – [in] Notification callback function. This function will be called every time a state change occurs, an error occurs or a mailbox transfer terminates.
* **pCallerData** – [in] Pointer to a caller data area which will be passed to the client on every notification callback
* **pRegResults** – [out] Registration results, a pointer to a structure of type [EC_T_REGISTERRESULTS](#dc/d06/struct_e_c___t___r_e_g_i_s_t_e_r_r_e_s_u_l_t_s)
* **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 or the output pointer is EC_NULL
* [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
### typedef [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) (\*EC_PF_NOTIFY)([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwCode, [EC_T_NOTIFYPARMS](api_notifications.html.md#_CPPv416EC_T_NOTIFYPARMS) \*pParms)
* **Param dwCode:**
**[in]** Notification code, see EC_NOTIFY_…
* **Param pParms:**
**[in]** Notification code depending data
### struct EC_T_REGISTERRESULTS
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwClntId
[out] Client ID
### [EC_T_BYTE](toc_api.html.md#_CPPv49EC_T_BYTE) \*pbyPDIn
[out] Pointer to process data input memory
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPDInSize
[out] Size of process data input memory (in bytes)
### [EC_T_BYTE](toc_api.html.md#_CPPv49EC_T_BYTE) \*pbyPDOut
[out] Pointer to process data output memory
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPDOutSize
[out] Size of process data output memory (in bytes)
### **emRegisterClient() Example**
```cpp
EC_T_REGISTERRESULTS oRegResults;
OsMemset(&oRegResults, 0, sizeof(EC_T_REGISTERRESULTS));
dwRes = emRegisterClient(dwInstanceId, myAppNotify, pvMyAppContext, &oRegResults);
```
## emUnregisterClient
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatUnregisterClient([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwClntId)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emUnregisterClient([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwClntId)
Unregister a client from the EtherCAT master.
This function may not be called from within the JobTask’s context.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **dwClntId** – [in] Client ID determined when registering with the master
* **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
## emGetSrcMacAddress
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatGetSrcMacAddress(ETHERNET_ADDRESS \*pMacSrc)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emGetSrcMacAddress([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, ETHERNET_ADDRESS \*pMacSrc)
Gets the source MAC address.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pMacSrc** – [out] 6-byte buffer to write source MAC address to
* **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
#### SEE ALSO
[`EC_T_INIT_MASTER_PARMS::pLinkParms`](#_CPPv4N22EC_T_INIT_MASTER_PARMS10pLinkParmsE)
### **emGetSrcMacAddress() Example**
```cpp
/* get MAC address of EtherCAT network adapter */
ETHERNET_ADDRESS oMacSrc;
OsMemset(&oMacSrc, 0, sizeof(ETHERNET_ADDRESS));
dwRes = emGetSrcMacAddress(dwInstanceId, &oMacSrc);
```
## emSetMasterState
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatSetMasterState([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout, [EC_T_STATE](#_CPPv410EC_T_STATE) eReqState)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emSetMasterState([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout, [EC_T_STATE](#_CPPv410EC_T_STATE) eReqState)
Set the master (and all slaves) into the requested EtherCAT state.
If the function is called with EC_NOWAIT, the client may wait for reaching the requested state using the notification callback (EC_NOTIFY_STATECHANGED).
By default the Master will just change to a higher state if all slaves have reached the requested state. It may happen that some slaves are in higher state at network than the Master, e.g.:
* Master and all slaves are in PREOP
* Application requests SAFEOP
* Master starts transition for all slaves
* Some slaves changed to SAFEOP, but some fail and therefore stay in PREOP
* Master state stays in PREOP, function returns with error
The application can request SAFEOP again to re-request the state of previously failed slaves. Transition to a lower state: The master changes to a lower state even if one slave is not able to follow. This function may not be called from within the JobTask’s context with dwTimeout other than EC_NOWAIT.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **dwTimeout** – [in] Timeout [ms]. This function will block until the requested state is reached or the timeout elapsed. If the timeout value is set to EC_NOWAIT the function will return immediately.
* **eReqState** – [in] Requested System state
* **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
* [EC_E_TIMEOUT](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_1ga2d09527654c655e159d26d36143674cb) if dwTimeout elapsed during the API call
* [EC_E_MASTER_RED_STATE_INACTIVE](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_1gae2870f20d370920995e27b2a78171a5e) if Master Redundancy is configured and master is inactive
* [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_STATE
*Values:*
### enumerator eEcatState_UNKNOWN
Unknown state
### enumerator eEcatState_INIT
EtherCAT state INIT
### enumerator eEcatState_PREOP
EtherCAT state PREOP (pre-operational)
### enumerator eEcatState_SAFEOP
EtherCAT state SAFEOP (safe operational)
### enumerator eEcatState_OP
EtherCAT state OP (operational)
### enumerator eEcatState_BOOTSTRAP
EtherCAT state BOOTSTRAP
### **emSetMasterState() Example**
```cpp
/* set EtherCAT master (and all slaves) into requested state */
dwRes = emSetMasterState(dwInstanceId, 5000, eEcatState_PREOP);
```
#### SEE ALSO
[emIoCtl - EC_IOCTL_ALL_SLAVES_MUST_REACH_MASTER_STATE](api_slave_control.html.md#emioctl-ec-ioctl-all-slaves-must-reach-master-state)
## emSetMasterStateReq
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatSetMasterStateReq([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout, [EC_T_STATE](#_CPPv410EC_T_STATE) eReqState)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emSetMasterStateReq([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTimeout, [EC_T_STATE](#_CPPv410EC_T_STATE) eReqState)
Request to set the master (and all slaves) into the requested EtherCAT state and return immediately.
The Master by default will just change to a higher state, if all slaves have reached the requested state. It may happen that some slaves are in higher state at network than Master, e.g.:
* Master and all slaves are in PREOP
* Application requests SAFEOP
* Master starts transition for all slaves
* Some slaves changed to SAFEOP, but some fail and therefore stay in PREOP
* Master state stays in PREOP, function returns with error
The application can request SAFEOP again to re-request state of previously failed slaves. Transition to lower state: The master changes to lower state, even if one slave is not able to follow.
See also EC_NOTIFY_STATECHANGED.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **dwTimeout** – [in] Timeout [ms]. This function will block until the requested state is reached or the timeout elapsed. If the timeout value is set to EC_NOWAIT the function will return immediately.
* **eReqState** – [in] Requested System state
* **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
* [EC_E_MASTER_RED_STATE_INACTIVE](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_1gae2870f20d370920995e27b2a78171a5e) if Master Redundancy is configured and master is inactive
* [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 ADS server is running
### **emSetMasterStateReq() Example**
```cpp
/* set EtherCAT master (and all slaves) into requested state */
dwRes = emSetMasterStateReq(dwInstanceId, 5000, eEcatState_PREOP);
```
#### SEE ALSO
[emIoCtl - EC_IOCTL_ALL_SLAVES_MUST_REACH_MASTER_STATE](api_slave_control.html.md#emioctl-ec-ioctl-all-slaves-must-reach-master-state)
#### SEE ALSO
[`emSetMasterState()`](#_CPPv416emSetMasterState10EC_T_DWORD10EC_T_DWORD10EC_T_STATE)
## emGetMasterState
### static [EC_T_STATE](#_CPPv410EC_T_STATE) ecatGetMasterState(EC_T_VOID)
### [EC_T_STATE](#_CPPv410EC_T_STATE) emGetMasterState([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID)
Get the EtherCAT master current state.
* **Parameters:**
**dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **Returns:**
EtherCAT master state
### **emGetMasterState() Example**
```cpp
EC_T_STATE eMasterState = emGetMasterState(dwInstanceId);
EcLogMsg(EC_LOG_LEVEL_INFO, (pEcLogContext, EC_LOG_LEVEL_INFO,
"Current Master State: %s:\n", ecatStateToStr(eMasterState)));
```
## emGetMasterStateEx
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatGetMasterStateEx([EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) \*pwCurrState, [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) \*pwReqState)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emGetMasterStateEx([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) \*pwCurrState, [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) \*pwReqState)
Get the EtherCAT master current and requested state. Possible return values for current and requested state:
* [DEVICE_STATE_UNKNOWN](api_slave_control.html.md#dd/dc3/group___d_e_v_i_c_e___s_t_a_t_e_s_1ga33b90f5429fe46ff40e374be0d64c76b)
* [DEVICE_STATE_INIT](api_slave_control.html.md#dd/dc3/group___d_e_v_i_c_e___s_t_a_t_e_s_1ga2a184454821e98410d522211abc6e136)
* [DEVICE_STATE_PREOP](api_slave_control.html.md#dd/dc3/group___d_e_v_i_c_e___s_t_a_t_e_s_1ga0b667c3c6c197200043dde1cc401e5e1)
* [DEVICE_STATE_SAFEOP](api_slave_control.html.md#dd/dc3/group___d_e_v_i_c_e___s_t_a_t_e_s_1ga185291cf09a7d9dd5dfa8461d90e39c7)
* [DEVICE_STATE_OP](api_slave_control.html.md#dd/dc3/group___d_e_v_i_c_e___s_t_a_t_e_s_1ga9e6fe68bf128d21867c80f053b29a76a)
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pwCurrState** – [out] Current master state
* **pwReqState** – [out] Requested master state
* **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 or the output pointers are EC_NULL
### **emGetMasterStateEx() Example**
```cpp
EC_T_WORD wCurrState = 0;
EC_T_WORD wReqState = 0;
/* get EtherCAT master current state */
dwRes = emGetMasterStateEx(dwInstanceId, &wCurrState, &wReqState);
EcLogMsg(EC_LOG_LEVEL_INFO, (pEcLogContext, EC_LOG_LEVEL_INFO,
"Current state: %s, requested state: %s\n",
ecatDeviceStateText(wCurrState), ecatDeviceStateText(wReqState)));
```
## emExecJob
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatExecJob([EC_T_USER_JOB](#_CPPv413EC_T_USER_JOB) eUserJob, [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS) \*pUserJobParms)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emExecJob([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_USER_JOB](#_CPPv413EC_T_USER_JOB) eUserJob, [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS) \*pUserJobParms)
Execute or initiate the requested job.
To achieve maximum speed, this function is implemented non re-entrant. It is highly recommended that only one single task is calling all required jobs to run the stack. If multiple tasks are calling this function, the calls have to be synchronized externally. Calling it in a context that doesn’t support operating system calls can lead to unpredictable behavior.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **eUserJob** – [in] User requested job
* **pUserJobParms** – [in] Optional user job parameters
* **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 or the output pointer is EC_NULL
* [EC_E_LINK_DISCONNECTED](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_1ga8dac899f16df522b9c6754c7d8d0fb72) if the link is disconnected
* [EC_E_FEATURE_DISABLED](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_1gab1113b4cdd40bec6cddbd07d8780ff8a) for eUsrJob_SwitchEoeFrames if EC_IOCTL_SET_EOE_DEFFERED_SWITCHING_ENABLED hasn’t be called before
* [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
*Brief job overview:*
### enum EC_T_USER_JOB
*Values:*
### enumerator eUsrJob_Undefined
### enumerator eUsrJob_ProcessAllRxFrames
### enumerator eUsrJob_SendAllCycFrames
### enumerator eUsrJob_MasterTimer
### enumerator eUsrJob_SendAcycFrames
### enumerator eUsrJob_SendCycFramesByTaskId
### enumerator eUsrJob_MasterTimerMinimal
### enumerator eUsrJob_ProcessRxFramesByTaskId
### enumerator eUsrJob_ProcessAcycRxFrames
### enumerator eUsrJob_SwitchEoeFrames
### enumerator eUsrJob_StartTask
### enumerator eUsrJob_StopTask
### enumerator eUsrJob_StampSendAllCycFrames
### enumerator eUsrJob_StampSendCycFramesByTaskId
### enumerator eUsrJob_SimulatorTimer
### enumerator eUsrJob_MonitorTimer
### union EC_T_USER_JOB_PARMS
### Public Members
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bAllCycFramesProcessed
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwNumFramesSent
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskIdToSend
### struct [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS)::[\_SEND_CYCFRAME_BY_TASKID](#_CPPv4N19EC_T_USER_JOB_PARMS24_SEND_CYCFRAME_BY_TASKIDE) SendCycFramesByTaskId
### struct [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS)::[\_PROCESS_RXFRAME_BY_TASKID](#_CPPv4N19EC_T_USER_JOB_PARMS26_PROCESS_RXFRAME_BY_TASKIDE) ProcessRxFramesByTaskId
### struct [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS)::[\_SWITCH_EOE_FRAMES](#_CPPv4N19EC_T_USER_JOB_PARMS18_SWITCH_EOE_FRAMESE) SwitchEoeFrames
### struct [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS)::[\_START_TASK](#_CPPv4N19EC_T_USER_JOB_PARMS11_START_TASKE) StartTask
### struct [EC_T_USER_JOB_PARMS](#_CPPv419EC_T_USER_JOB_PARMS)::[\_STOP_TASK](#_CPPv4N19EC_T_USER_JOB_PARMS10_STOP_TASKE) StopTask
### struct \_PROCESS_RXFRAME_BY_TASKID
### Public Members
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bCycFramesProcessed
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId
### struct \_SEND_CYCFRAME_BY_TASKID
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId
### struct \_START_TASK
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId
### struct \_STOP_TASK
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId
### struct \_SWITCH_EOE_FRAMES
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxPortsToProcess
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwNumFramesProcessed
*Detailed job description:*
1. [`eUsrJob_ProcessAllRxFrames`](#_CPPv4N13EC_T_USER_JOB26eUsrJob_ProcessAllRxFramesE)
: When the Real-time Ethernet Driver operates in polling mode this call will process all currently received frames, when the Real-time Ethernet Driver operates in interrupt mode all received frames are processed immediately and this call just returns with nothing done.
```cpp
pUserJobParms->bAllCycFramesProcessed
```
If this flag is set to a value of [`EC_TRUE`](toc_api.html.md#c.EC_TRUE) it indicates that all previously initiated cyclic frames ( [`eUsrJob_SendAllCycFrames`](#_CPPv4N13EC_T_USER_JOB24eUsrJob_SendAllCycFramesE) ) are received and processed within this call. Not used if pUserJobParms is set to [`EC_NULL`](toc_api.html.md#c.EC_NULL).
Return: [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) if successful, error code in case of failures.
2. [`eUsrJob_SendAllCycFrames`](#_CPPv4N13EC_T_USER_JOB24eUsrJob_SendAllCycFramesE)
: Send all cyclic frames. New values will be written to the EtherCAT® SubDevice’s outputs and new input values will be received. If the Real-time Ethernet Driver operates in interrupt mode, the process data input values will be updated immediately after receiving the frames. If the Real-time Ethernet Driver operates in polling mode, the next call to [`emExecJob()`](#_CPPv49emExecJob10EC_T_DWORD13EC_T_USER_JOBP19EC_T_USER_JOB_PARMS) with the [`eUsrJob_ProcessAllRxFrames`](#_CPPv4N13EC_T_USER_JOB26eUsrJob_ProcessAllRxFramesE) job will check for received frames and update the process data input values.
```cpp
pUserJobParms->dwNumFramesSent
```
Indicates number of frames sent within this call. Not used if pUserJobParms is set to [`EC_NULL`](toc_api.html.md#c.EC_NULL).
Return: [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) if successful, error code in case of failures.
In case not all previously initiated cyclic frames are processed when calling this function an error notification will be generated ( [emNotify - EC_NOTIFY_FRAME_RESPONSE_ERROR](api_diagnosis.html.md#emnotify-ec-notify-frame-response-error)).
3. [`eUsrJob_SendAcycFrames`](#_CPPv4N13EC_T_USER_JOB22eUsrJob_SendAcycFramesE)
: Acyclic EtherCAT® datagrams stored in the acyclic frame buffer FIFO will be sent when executing this call.
```cpp
pUserJobParms->dwNumFramesSent
```
Indicates number of frames sent within this call. Not used if pUserJobParms is set to [`EC_NULL`](toc_api.html.md#c.EC_NULL).
Return: [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) if successful, error code in case of failures.
4. [`eUsrJob_MasterTimer`](#_CPPv4N13EC_T_USER_JOB19eUsrJob_MasterTimerE)
: To trigger the MainDevice and SubDevice state machines as well as the mailbox handling this call has to be executed cyclically. The MainDevice cycle time is determined by the period between calling [`emExecJob()`](#_CPPv49emExecJob10EC_T_DWORD13EC_T_USER_JOBP19EC_T_USER_JOB_PARMS) ( [`eUsrJob_MasterTimer`](#_CPPv4N13EC_T_USER_JOB19eUsrJob_MasterTimerE)). The state-machines are handling the EtherCAT® state change transfers.
Return: [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) if successful, error code in case of failures.
5. [`eUsrJob_SendCycFramesByTaskId`](#_CPPv4N13EC_T_USER_JOB29eUsrJob_SendCycFramesByTaskIdE)
: Send cyclic frames related to a specific task id. If more than one cyclic entries are configured this user job can be used to send the appropriate cyclic frames. All frames stored in cyclic entries with the given task id will be sent.
#### SEE ALSO
[Multiple cyclic entries configuration](software-integration_eni-configuration.html.md#multiple-cyclic-entries-configuration)
```cpp
pUserJobParms->SendCycFramesByTaskId.dwTaskId
```
Task id.
Return: [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) if successful, error code in case of failures. If not all previously initiated cyclic frames for the same task are already processed when calling this function an error will be generated ( [emNotify - EC_NOTIFY_FRAME_RESPONSE_ERROR](api_diagnosis.html.md#emnotify-ec-notify-frame-response-error)).
6. [`eUsrJob_ProcessRxFramesByTaskId`](#_CPPv4N13EC_T_USER_JOB31eUsrJob_ProcessRxFramesByTaskIdE)
: [`eUsrJob_ProcessAcycRxFrames`](#_CPPv4N13EC_T_USER_JOB27eUsrJob_ProcessAcycRxFramesE)
#### SEE ALSO
Feature-Pack Split Frame Processing
7. [`eUsrJob_SwitchEoeFrames`](#_CPPv4N13EC_T_USER_JOB23eUsrJob_SwitchEoeFramesE)
: This job must be called if [emIoCtl - EC_IOCTL_SET_EOE_DEFFERED_SWITCHING_ENABLED](#emioctl-ec-ioctl-set-eoe-deffered-switching-enabled) has been called before. It can be called in parallel to Send / Process jobs in a lower prioritized task
```cpp
pUserJobParms->SwitchEoeFrames.dwMaxPortsToProcess
```
Indicates number of ports to be processed within this call. If zero, all ports will be processed.
```cpp
pUserJobParms->SwitchEoeFrames.dwNumFramesProcessed
```
Returns number of frames processed within this call.
Return: [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) if successful
8. [`eUsrJob_StartTask`](#_CPPv4N13EC_T_USER_JOB17eUsrJob_StartTaskE)
: Inform EC-Master that the current task is started. Specify pUserJobParms.StartTask.dwTaskId or pass pUserJobParms set to EC_NULL for task ID 0.
9. [`eUsrJob_StopTask`](#_CPPv4N13EC_T_USER_JOB16eUsrJob_StopTaskE)
: Inform EC-Master that the current task is stopped. Specify pUserJobParms.StopTask.dwTaskId or pass pUserJobParms set to EC_NULL for task ID 0.
### **emExecJob() Example**
```cpp
EC_T_USER_JOB oUserJob;
OsMemset(&oUserJob, 0, sizeof(EC_T_USER_JOB));
oUserJob = eUsrJob_StartTask;
EC_T_USER_JOB_PARMS oUserJobParms;
OsMemset(&oUserJobParms, 0, sizeof(EC_T_USER_JOB));
dwRes = emExecJob(dwInstanceId, oUserJob, &oUserJobParms);
```
## emGetVersion
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatGetVersion([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwVersion, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwVersionType)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emGetVersion([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwVersion, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*pdwVersionType)
Gets the version information.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **pdwVersion** – [out] Pointer to EC_T_DWORD to carry out version number as a 32-bit value
* **pdwVersionType** – [out] Pointer to EC_T_DWORD to carry out version type. See [EC_VERSION_TYPE](#d2-d96-group-e-c-v-e-r-s-i-o-n-t-y-p-e-s).
* **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 or the output pointer is EC_NULL
**EC Version Type**
### EC_VERSION_TYPE_UNDEFINED
EC-Master Type Undefined
### EC_VERSION_TYPE_UNRESTRICTED
EC-Master Type Unrestricted
### EC_VERSION_TYPE_PROTECTED
EC-Master Type Protected
### EC_VERSION_TYPE_DONGLED
EC-Master Type Dongled
### EC_VERSION_TYPE_EVAL
EC-Master Type Eval
### **emGetVersion() Example**
```cpp
/* get stack version */
EC_T_DWORD dwVersion = EC_E_ERROR;
EC_T_DWORD dwVersionType = 0;
dwRes = emGetVersion(dwInstanceId, &dwVersion, &dwVersionType);
```
## emSetLicenseKey
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatSetLicenseKey(const [EC_T_CHAR](toc_api.html.md#_CPPv49EC_T_CHAR) \*szLicenseKey)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emSetLicenseKey([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, const [EC_T_CHAR](toc_api.html.md#_CPPv49EC_T_CHAR) \*szLicenseKey)
Sets the license key for the protected version of EC-Master.
Must be called after initialization and before configuration. This function may not be called if a non protected version is used.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **szLicenseKey** – [in] License key as zero terminated string with 26, 53 or 56 characters
* **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
* [EC_E_INVALIDSIZE](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_1gacd9f0baea7a294f85c3f5bde1543d1d0) if the format of the license key is wrong. The correct length is 26, 53 or 56 characters.
* [EC_E_LICENSE_MISSING](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_1ga810a43bd89a1ef6ffa39af31090ac83e) if the license key doesn’t match the MAC Address
### **emSetLicenseKey() Example**
```cpp
dwRes = emSetLicenseKey(dwInstanceId, "DA1099F2-15C249E9-54327FBC");
```
#### SEE ALSO
- [`emInitMaster()`](#_CPPv412emInitMaster10EC_T_DWORDPK22EC_T_INIT_MASTER_PARMS)
- [`emConfigureNetwork()`](#_CPPv418emConfigureNetwork10EC_T_DWORD13EC_T_CNF_TYPE10EC_T_PBYTE10EC_T_DWORD)
## emSetOemKey
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatSetOemKey(EC_T_UINT64 qwOemKey)
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emSetOemKey([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, EC_T_UINT64 qwOemKey)
Provide OEM Key needed for OEM Masters to parse ENI files and provide access via RAS. Must be called after initialization and before configuration.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **qwOemKey** – [in] 64 bit OEM key
### **emSetOemKey() Example**
```cpp
dwRes = emSetOemKey(dwInstanceId, 0x1234567812345678);
```
#### SEE ALSO
- [`emInitMaster()`](#_CPPv412emInitMaster10EC_T_DWORDPK22EC_T_INIT_MASTER_PARMS)
- [`emConfigureNetwork()`](#_CPPv418emConfigureNetwork10EC_T_DWORD13EC_T_CNF_TYPE10EC_T_PBYTE10EC_T_DWORD)
## emIoCtl
### static [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) ecatIoCtl([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwCode, const EC_T_VOID \*const pbyInBuf, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInBufSize, EC_T_VOID \*const pbyOutBuf, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwOutBufSize, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*const pdwNumOutData)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) emIoCtl([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInstanceID, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwCode, const EC_T_VOID \*const pbyInBuf, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInBufSize, EC_T_VOID \*const pbyOutBuf, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwOutBufSize, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) \*const pdwNumOutData)
A generic control interface between the application, the EtherCAT stack and its Link Layers.
* **Parameters:**
* **dwInstanceID** – [in] Instance ID (Multiple EtherCAT Network Support)
* **dwCode** – [in] IOCTL code (EC_IOCTL…)
* **pbyInBuf** – [in] IOCTL input parameters
* **dwInBufSize** – [in] Size of IOCTL input parameters in bytes
* **pbyOutBuf** – [out] Buffer for IOCTL output
* **dwOutBufSize** – [in] Size of buffer at pbyOutBuf in bytes
* **pdwNumOutData** – [out] Amount of bytes written to pbyOutBuf by IOCTL. EC_NULL: amount not set by IOCTL.
* **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 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
## emIoCtl - EC_IOCTL_GET_PDMEMORYSIZE
### EC_IOCTL_GET_PDMEMORYSIZE
Get the process data image size. This information may be used to provide process data image storage from outside the core. This IOCTL is to be called after network configuration.
* **Parameters:**
* **pbyInBuf** – [in] Should be set to EC_NULL
* **dwInBufSize** – [in] Should be set to 0
* **pbyOutBuf** – [out] Pointer to memory where the memory size information will be stored (type: [EC_T_MEMREQ_DESC](#da/df0/struct_e_c___t___m_e_m_r_e_q___d_e_s_c))
* **dwOutBufSize** – [in] Size of the output buffer in bytes
* **pdwNumOutData** – [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
* **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
### struct EC_T_MEMREQ_DESC
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPDOutSize
Size of the output process data image
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPDInSize
Size of the input process data image
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_REGISTER_PDMEMORYPROVIDER
### EC_IOCTL_REGISTER_PDMEMORYPROVIDER
This function call registers an external memory provider to the stack, this memory will be used to store process data. If no memory provider is registered the stack will internally allocate the necessary amount of memory. The function [EC_IOCTL_GET_PDMEMORYSIZE](#d0/d35/_ec_io_ctl_8h_1aab1c5dd0794f6d2aafe8ecf3a3094b42) should be executed to determine the amount of memory the stack needs to store process data values. An external memory provider may additionally supply some hooks to give the stack a possibility to synchronize memory access with the application. Also the memory provider has to be registered after configuring the network but prior to registering any client. Every client that registers with the stack will get back the memory pointers to PDOut/PDIn data registered within this call.
* **Parameters:**
* **pbyInBuf** – [in] Memory provider ([EC_T_MEMPROV_DESC](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c))
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
### struct EC_T_MEMPROV_DESC
### Public Members
### [EC_T_PVOID](toc_api.html.md#_CPPv410EC_T_PVOID) pvContext
Context pointer. This pointer is used every time one of the callback functions (e.g. pfPDOutReadRequest) is called.
### [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) pbyPDOutData
Pointer to the fixed output process data buffer (values transferred from the master to the slaves). A value of EC_NULL may be given in case the pointer will be provided later when the function [EC_T_MEMPROV_DESC.pfPDOutDataReadRequest](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c_1a2a4d36753f2c3cdbd529c578939307a6) is called.
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPDOutDataLength
Length of the output process data buffer
### [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) pbyPDInData
Pointer to the fixed input process data buffer (values transferred from the slaves to the master). A value of EC_NULL may be given in case the pointer will be provided later when the function [EC_T_MEMPROV_DESC.pfPDInDataWriteRequest](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c_1ac4fa95d642804b955de5ae6cde1da477) is called.
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPDInDataLength
Length of the input process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfPDOutDataReadRequest
This function will be called cyclically within the process data transfer cycle prior to reading data from the output process data buffer. If EC_NULL is set, the fixed buffer [EC_T_MEMPROV_DESC.pbyPDOutData](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c_1a73d668e08f6422100f1df75aadd19e94) is used.
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfPDOutDataReadRelease
This function will be called cyclically within the process data transfer cycle after all data were read from the output process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfPDOutDataWriteRequest
This function will be called cyclically within the process data transfer cycle prior to writing new data into the output process data buffer. If EC_NULL is set, the fixed buffer [EC_T_MEMPROV_DESC.pbyPDOutData](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c_1a73d668e08f6422100f1df75aadd19e94) is used.
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfPDOutDataWriteRelease
This function will be called cyclically within the process data transfer cycle after all data were written into the output process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfPDInDataWriteRequest
This function will be called cyclically within the process data transfer cycle prior to writing new data into the input process data buffer. If EC_NULL is set, the fixed buffer [EC_T_MEMPROV_DESC.pbyPDInData](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c_1a46bab8e220e17412e5344c5036d31b8f) is used.
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfPDInDataWriteRelease
This function will be called cyclically within the process data transfer cycle after all data were written into the input process data buffer
### [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) pbyMasterRedPDOutData
Pointer to the MasterRed output process data buffer (ACTIVE to INACTIVE)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMasterRedPDOutDataLength
Length of the MasterRed output process data buffer
### [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) pbyMasterRedPDInData
Pointer to the default input process data buffer (INACTIVE to ACTIVE)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMasterRedPDInDataLength
Length of the input process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfMasterRedPDOutReadRequest
This function will be called within the process data transfer cycle prior to reading data
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfMasterRedPDOutReadRelease
This function will be called after all data has been read from the output process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfMasterRedPDOutWriteRequest
This function will be called within the process data transfer cycle prior to reading data
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfMasterRedPDOutWriteRelease
This function will be called after all data were read from the output process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfMasterRedPDInWriteRequest
This function will be called within the process data transfer cycle prior to writing data
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfMasterRedPDInWriteRelease
This function will be called after all data were written to the input process data buffer
### [EC_T_PFMEMREQ](#_CPPv413EC_T_PFMEMREQ) pfMasterRedPDInReadRequest
This function will be called within the process data transfer cycle prior to writing data
### [EC_T_PFMEMREL](#_CPPv413EC_T_PFMEMREL) pfMasterRedPDInReadRelease
This function will be called after all data were written to the input process data buffer
### typedef EC_T_VOID (\*EC_T_PFMEMREQ)([EC_T_PVOID](toc_api.html.md#_CPPv410EC_T_PVOID) pvContext, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId, [EC_T_PBYTE](toc_api.html.md#_CPPv410EC_T_PBYTE) \*ppbyPDData)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Param dwTaskId:**
**[in]** Task ID of cyclic data transfer (ENI: Cyclic/TaskId). If TASKID_COMPLETE_PD is given, the function must return a complete output process data buffer which contains valid data for all cyclic tasks.
* **Param ppbyPDData:**
**[out]** Pointer to the process data buffer to be used. If set to EC_NULL, the corresponding fixed buffer from [EC_T_MEMPROV_DESC](#d6/df3/struct_e_c___t___m_e_m_p_r_o_v___d_e_s_c) is used. The provided buffer size must correspond to the caller context.
### typedef EC_T_VOID (\*EC_T_PFMEMREL)([EC_T_PVOID](toc_api.html.md#_CPPv410EC_T_PVOID) pvContext, [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId)
* **Param pvContext:**
**[in]** Arbitrarily application-defined parameter passed to callback
* **Param dwTaskId:**
**[in]** Task ID of cyclic data transfer (ENI: Cyclic/TaskId)
#### SEE ALSO
- [emIoCtl - EC_IOCTL_GET_PDMEMORYSIZE](#emioctl-ec-ioctl-get-pdmemorysize)
- [`emConfigureNetwork()`](#_CPPv418emConfigureNetwork10EC_T_DWORD13EC_T_CNF_TYPE10EC_T_PBYTE10EC_T_DWORD)
- [`emRegisterClient()`](#_CPPv416emRegisterClient10EC_T_DWORD12EC_PF_NOTIFYP9EC_T_VOIDP20EC_T_REGISTERRESULTS)
- Feature Pack “MainDevice Redundancy”
- [`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_REGISTER_CYCFRAME_RX_CB
### EC_IOCTL_REGISTER_CYCFRAME_RX_CB
Register callback for all cyclic frames received. Typically this is used when the Real-time Ethernet Driver operates in interrupt mode to get an event when the new input data (cyclic frame) is available. The callback function has to be registered after the stack initialization and before starting the job task.
* **Parameters:**
* **pbyInBuf** – [in] Cyclic frame received callback descriptor ([EC_T_CYCFRAME_RX_CBDESC](#dd/dff/struct_e_c___t___c_y_c_f_r_a_m_e___r_x___c_b_d_e_s_c))
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
### struct EC_T_CYCFRAME_RX_CBDESC
### Public Members
### EC_T_VOID \*pCallbackContext
[in] Context pointer. This pointer is used as parameter every time the callback function is called.
### [EC_PF_CYCFRAME_RECV](#_CPPv419EC_PF_CYCFRAME_RECV) pfnCallback
[in] This function will be called after the cyclic frame is received, if there is more than one cyclic frame after the last frame. The application has to assure that these functions will not block.
### typedef EC_T_VOID (\*EC_PF_CYCFRAME_RECV)([EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId, EC_T_VOID \*pvContext)
* **Param dwTaskId:**
[in] Task id of the received cyclic frame
* **Param pvContext:**
[in] Context pointer. This pointer is used as parameter every time when the callback function is called.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_ISLINK_CONNECTED
### EC_IOCTL_ISLINK_CONNECTED
Determine whether the main link or redundancy link is connected.
#### NOTE
See also EC_IOCTL_IS_MAIN_LINK_CONNECTED, EC_IOCTL_IS_RED_LINK_CONNECTED
* **Parameters:**
* **pbyInBuf** – [in] Should be set to EC_NULL
* **dwInBufSize** – [in] Should be set to 0
* **pbyOutBuf** – [out] Pointer to EC_T_DWORD or EC_T_LINK_CONNECTED_INFO. EC_T_DWORD: If value is EC_TRUE link is connected, if EC_FALSE it is not.
* **dwOutBufSize** – [in] Size of the output buffer in bytes (sizeof(EC_T_DWORD) / sizeof(EC_T_LINK_CONNECTED_INFO))
* **pdwNumOutData** – [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
* **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
With Redundancy support enabled, [`EC_FALSE`](toc_api.html.md#c.EC_FALSE) is only set if MainPort and RedPort are down.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_GET_LINKLAYER_MODE
### EC_IOCTL_GET_LINKLAYER_MODE
Get Real-time Ethernet Driver mode (EcLinkMode_POLLING, EcLinkMode_INTERRUPT)
* **Parameters:**
* **pbyInBuf** – [in] Should be set to EC_NULL
* **dwInBufSize** – [in] Should be set to 0
* **pbyOutBuf** – [out] Pointer to struct [EC_T_LINKLAYER_MODE_DESC](#db/d79/struct_e_c___t___l_i_n_k_l_a_y_e_r___m_o_d_e___d_e_s_c)
* **dwOutBufSize** – [in] Size of the output buffer in bytes
* **pdwNumOutData** – [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
* **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
### struct EC_T_LINKLAYER_MODE_DESC
### Public Members
### [EC_T_LINKMODE](emll_init.html.md#_CPPv413EC_T_LINKMODE) eLinkMode
[out] Operation mode of main interface
### [EC_T_LINKMODE](emll_init.html.md#_CPPv413EC_T_LINKMODE) eLinkModeRed
[out] Operation mode of redundancy interface
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_GET_CYCLIC_CONFIG_INFO
### EC_IOCTL_GET_CYCLIC_CONFIG_INFO
Get cyclic configuration information from ENI file.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to dwCycEntryIndex: Cyclic entry index for which to get information
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Pointer to [EC_T_CYC_CONFIG_DESC](#d2/d75/struct_e_c___t___c_y_c___c_o_n_f_i_g___d_e_s_c) data type
* **dwOutBufSize** – [in] Size of the output buffer provided at pbyOutBuf in bytes
* **pdwNumOutData** – [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
* **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
### struct EC_T_CYC_CONFIG_DESC
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwNumCycEntries
[out] Total number of cyclic entries
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwTaskId
[out] Task ID of selected cyclic entry (ENI: Cyclic/TaskId)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwPriority
[out] Priority of selected cyclic entry
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwCycleTime
[out] Cycle time of selected cyclic entry
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_IS_SLAVETOSLAVE_COMM_CONFIGURED
### EC_IOCTL_IS_SLAVETOSLAVE_COMM_CONFIGURED
Determine if any slave to slave communication is configured.
* **Parameters:**
* **pbyInBuf** – [in] Should be set to EC_NULL
* **dwInBufSize** – [in] Should be set to 0
* **pbyOutBuf** – [out] Pointer to EC_T_DWORD. If value is EC_TRUE slave to slave communication is configured, if EC_FALSE it is not.
* **dwOutBufSize** – [in] Size of the output buffer in bytes
* **pdwNumOutData** – [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
* **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
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_LINKIOCTL…
The generic control interface provides access to the main network adapter when adding `EC_IOCTL_LINKLAYER_MAIN` to the `EC_LINKIOCTL` parameter at dwCode.
```cpp
EC_T_DWORD dwCode = (EC_IOCTL_LINKLAYER_MAIN | EC_LINKIOCTL_GET_ETHERNET_ADDRESS);
```
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_LINKIOCTL_GET_ETHERNET_ADDRESS
Provides MAC addresses of main or red line.
**emIoCtl - EC_LINKIOCTL_GET_ETHERNET_ADDRESS**
: **Parameter**
: * `pbyInBuf`: [in] Should be set to EC_NULL
* `dwInBufSize`: [in] Should be set to 0
* `pbyOutBuf`: [out] Pointer to MAC address buffer (6 bytes)
* `dwOutBufSize`: [in] Size of the output buffer in bytes (at least 6)
* `pdwNumOutData`: [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
**Return**
: EC_E_NOERROR or error code
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_LINKIOCTL_GET_SPEED
**emIoCtl - EC_LINKIOCTL_GET_SPEED**
: **Parameter**
: * `pbyInBuf`: [in] Should be set to EC_NULL
* `dwInBufSize`: [in] Should be set to 0
* `pbyOutBuf`: [out] Pointer to EC_T_DWORD. Set by Real-time Ethernet Driver to 10/100/1000.
* `dwOutBufSize`: [in] Size of the output buffer in bytes
* `pdwNumOutData`: [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
**Return**
: EC_E_NOERROR or error code
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_LINKIOCTL_GET_PCI_INFO
Get current network adapter’s PCI information
**emIoCtl - EC_LINKIOCTL_GET_PCI_INFO**
: **Parameter**
: * `pbyInBuf`: [in] Should be set to EC_NULL
* `dwInBufSize`: [in] Should be set to 0
* `pbyOutBuf`: [out] Pointer to EC_T_PCI_INFO buffer
* `dwOutBufSize`: [in] Size of the output buffer in bytes. Must be at least the size of EC_T_PCI_INFO.
* `pdwNumOutData`: [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
**Return**
: EC_E_NOERROR or error code
### struct EC_T_PCI_INFO
### Public Members
### [EC_T_PCI_INFO_LOCATION](#_CPPv422EC_T_PCI_INFO_LOCATION) Location
PCI location (bus, device, function)
### [EC_T_PCI_INFO_IDENIFICATION](#_CPPv427EC_T_PCI_INFO_IDENIFICATION) Ident
PCI identification (vendor id, device id)
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwIoBarCnt
I/O bar count
### [EC_T_PCI_INFO_IOBAR](#_CPPv419EC_T_PCI_INFO_IOBAR) aIoBar
PCI I/O bars info
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMemBarCnt
Memory bar count
### [EC_T_PCI_INFO_MEMBAR](#_CPPv420EC_T_PCI_INFO_MEMBAR) aMemBar
PCI Memory bars info
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInterruptCnt
IRQ count
### [EC_T_PCI_INFO_INTERRUPT](#_CPPv423EC_T_PCI_INFO_INTERRUPT) aInterrupt
PCI IRQ info
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) adwReserved[16]
Reserved for future use
### struct EC_T_PCI_INFO_LOCATION
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwDomainNumber
Domain
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwBusNumber
Bus number
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwDeviceNumber
Device number
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwFunctionNumber
Function number
### struct EC_T_PCI_INFO_IDENIFICATION
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwVendorId
Vendor ID
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwDeviceId
Device ID
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwReserved
Reserved for future use
### struct EC_T_PCI_INFO_IOBAR
### Public Members
### EC_T_UINT64 qwBaseAddress
I/O bar base address
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwLen
Bar length
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwReserved
Reserved for future use
### struct EC_T_PCI_INFO_MEMBAR
### Public Members
### EC_T_UINT64 qwBaseAddress
Memory bar base address
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwLen
Bar length
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwReserved
Reserved for future use
### struct EC_T_PCI_INFO_INTERRUPT
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwIrq
IRQ number
### EC_T_CPUSET CpuAffinity
Reserved for future use
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) adwReserved[2]
Reserved for future use
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_CYCFRAME_LAYOUT
### EC_IOCTL_SET_CYCFRAME_LAYOUT
Set the cyclic frames layout.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to an [EC_T_CYCFRAME_LAYOUT](#d0/d35/_ec_io_ctl_8h_1a6ce49d0f8cdb66e9f92560d5430268b4) value containing the cyclic frame layout
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Pointer to EC_T_BOOL to carry out current enable set
* **dwOutBufSize** – [in] Size of the output buffer provided at pbyOutBuf in bytes
* **pdwNumOutData** – [out] Pointer to EC_T_DWORD. Amount of bytes written to the output buffer.
* **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
### enum EC_T_CYCFRAME_LAYOUT
*Values:*
### enumerator eCycFrameLayout_STANDARD
Layout according ENI with command add/reordering, no relationship to PD
### enumerator eCycFrameLayout_DYNAMIC
Layout is dynamically modified to send as few as possible cyclic frames and commands
### enumerator eCycFrameLayout_FIXED
Layout strictly match ENI, frame buffers and PD area overlapped
### enumerator eCycFrameLayout_IN_DMA
Layout strictly match ENI, frame buffers and PD area overlapped, frame buffers in DMA
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_MASTER_DEFAULT_TIMEOUTS
### EC_IOCTL_SET_MASTER_DEFAULT_TIMEOUTS
Set master default timeouts.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to [EC_T_MASTERDEFAULTTIMEOUTS_DESC](#db/dfc/struct_e_c___t___m_a_s_t_e_r_d_e_f_a_u_l_t_t_i_m_e_o_u_t_s___d_e_s_c)
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
### struct EC_T_MASTERDEFAULTTIMEOUTS_DESC
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMasterStateChange
Default state change timeout [ms], applied if emSetMasterState called with EC_NOWAIT
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwInitCmdRetry
Timeout [ms] between retry sending an init-command
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMbxCmd
Timeout [ms] between retry sending an mailbox command
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMbxPolling
Mailbox polling cycle [ms] ( default: 10 ms )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwDcmInSync
Timeout [ms] to wait for DCM InSync in state change PREOP to SAFEOP ( default: infinite )
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wInitCmd
Timeout [ms] to InitCmds if not specified in ENI ( default: 1100 ms )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSlaveIdentification
Timeout [ms] to wait for the reading of the slave identification ( default: 5000 )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwGenerateEni
Timeout [ms] to wait for eCnfType_GenPreopENI, eCnfType_GenOpENI, eCnfType_Gen… ( default: 30000 ms )
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwBootMbxPolling
Mailbox polling cycle [ms] for Boot ( default: 10 ms )
Setting a value of this descriptor to zero resets the default timeout value to the initial value.
#### SEE ALSO
- [`emSetMasterState()`](#_CPPv416emSetMasterState10EC_T_DWORD10EC_T_DWORD10EC_T_STATE)
- [`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_COPYINFO_IN_SENDCYCFRAMES
### EC_IOCTL_SET_COPYINFO_IN_SENDCYCFRAMES
Set copy info processed in either [eUsrJob_SendAllCycFrames](#d0/d7a/_ec_interface_common_8h_1a2896339cca5c839bfe2ee15381f32dbfac36e00fb71e0a6bcad659eb942d0e04c) or in [eUsrJob_ProcessAllRxFrames](#d0/d7a/_ec_interface_common_8h_1a2896339cca5c839bfe2ee15381f32dbfa7812f457083c392d7242823b1696ba98).
* **Parameters:**
* **pbyInBuf** – [in] Pointer to EC_T_BOOL. EC_TRUE: SendCycFrames, EC_FALSE: ProcessAllRxFrames.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Default: Set by ProcessAllRxFrames.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_BUS_CYCLE_TIME
### EC_IOCTL_SET_BUS_CYCLE_TIME
Set bus cycle time [us] master parameter without calling [emInitMaster()](#db/d74/_ec_master_api_8cpp_1a20396c6311952930b2a5c10c2baf2131) again.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_DWORD. Value may not be 0!
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Implicitly recalculates Order Timeout and [`EC_T_INIT_MASTER_PARMS::dwEcatCmdTimeout`](#_CPPv4N22EC_T_INIT_MASTER_PARMS16dwEcatCmdTimeoutE).
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_ADDITIONAL_VARIABLES_FOR_SPECIFIC_DATA_TYPES
### EC_IOCTL_ADDITIONAL_VARIABLES_FOR_SPECIFIC_DATA_TYPES
Enable or disable additional variables for specific data types. Default: Enabled.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: enable, EC_FALSE: disable.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Additional variables are added to the process image for the following data types:
- FSOE_4096
- FSOE_4098
- FSOE_4099
- FB Info 1
- FB Info 3
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SLV_ALIAS_ENABLE
### EC_IOCTL_SLV_ALIAS_ENABLE
Enables slave alias addressing for all slaves.
* **Parameters:**
* **pbyInBuf** – [in] Should be set to EC_NULL
* **dwInBufSize** – [in] Should be set to 0
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
#### IMPORTANT
All SubDevice need to have the correct alias address set! If in doubt, don’t use this IOCTL.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_IGNORE_INPUTS_ON_WKC_ERROR
### EC_IOCTL_SET_IGNORE_INPUTS_ON_WKC_ERROR
Set ignore INPUTs on WKC error.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: Ignore INPUTs on WKC error.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Calling this IOCTL with [`EC_TRUE`](toc_api.html.md#c.EC_TRUE) as parameter will ignore input data of cyclic commands on WKC error.
By default input data are updated if WKC is non zero. If WKC is not matching the expected value a notification [emNotify - EC_NOTIFY_CYCCMD_WKC_ERROR](api_diagnosis.html.md#emnotify-ec-notify-cyccmd-wkc-error) is generated and the application must consider this status for the current cycle.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_ZERO_INPUTS_ON_WKC_ERROR
### EC_IOCTL_SET_ZERO_INPUTS_ON_WKC_ERROR
Set INPUTs to zero on WKC error.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: INPUTs are set to zero on WKC error.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Calling this IOCTL with [`EC_TRUE`](toc_api.html.md#c.EC_TRUE) as parameter will set inputs to zero on WKC error.
By default input data are updated if WKC is non zero. If WKC is not matching the expected value a notification [emNotify - EC_NOTIFY_CYCCMD_WKC_ERROR](api_diagnosis.html.md#emnotify-ec-notify-cyccmd-wkc-error) is generated and the application must consider this status for the current cycle.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_ZERO_INPUTS_ON_WKC_ZERO
### EC_IOCTL_SET_ZERO_INPUTS_ON_WKC_ZERO
Set INPUTs to zero on WKC is zero.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: Set INPUTs to zero if WKC is zero.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Calling this IOCTL with [`EC_TRUE`](toc_api.html.md#c.EC_TRUE) as parameter will set inputs to zero on WKC is zero.
By default input data are ignored on WKC is zero and remain unchanged. If WKC is not matching the expected value a notification [emNotify - EC_NOTIFY_CYCCMD_WKC_ERROR](api_diagnosis.html.md#emnotify-ec-notify-cyccmd-wkc-error) is generated and the application must consider this status for the current cycle.
## emIoCtl - EC_IOCTL_SET_ZERO_INPUTS_ON_FRAME_LOSS
### EC_IOCTL_SET_ZERO_INPUTS_ON_FRAME_LOSS
Set inputs to zero on frame loss.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: Set inputs to zero on frame loss
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Calling this IOCTL with [`EC_TRUE`](toc_api.html.md#c.EC_TRUE) as parameter will set inputs to zero on frame loss.
By default input data are ignored on frame loss and remain unchanged.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_GENENI_ASSIGN_EEPROM_BACK_TO_ECAT
### EC_IOCTL_SET_GENENI_ASSIGN_EEPROM_BACK_TO_ECAT
Enable or disable creation of “assign EEPROM back to ECAT” InitCmd if ENI generated based on bus-scan result.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: generate InitCmd.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
The InitCmd “assign EEPROM back to ECAT” in the ENI depends on the attribute “AssignToPdi” of the EEPROM tag in the SubDevice’s description within the ESI file. Because this attribute is not reflected in the SII in the SubDevice’s EEPROM, the MainDevice cannot know its value and inserts the InitCmd by default for legacy reasons.
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_EOE_DEFFERED_SWITCHING_ENABLED
### EC_IOCTL_SET_EOE_DEFFERED_SWITCHING_ENABLED
Enable or disable deferred EoE switching.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_BOOL. EC_TRUE: Deferred EoE switching enabled.
* **dwInBufSize** – [in] Size of the input buffer provided at pbyInBuf in bytes
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
Enabling deferred EoE switching reduces the CPU load of JOB_ProcessAllRxFrames in case of EoE communication. [`eUsrJob_SwitchEoeFrames`](#_CPPv4N13EC_T_USER_JOB23eUsrJob_SwitchEoeFramesE) has to be called explicitly to switch the received EoE frames between the EoE SubDevices and EoE end point(s).
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_MAILBOX_POLLING_CYCLES
### EC_IOCTL_SET_MAILBOX_POLLING_CYCLES
Change the mailbox polling interval.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to struct [EC_T_SET_MAILBOX_POLLING_CYCLES_DESC](#d2/d39/struct_e_c___t___s_e_t___m_a_i_l_b_o_x___p_o_l_l_i_n_g___c_y_c_l_e_s___d_e_s_c)
* **dwInBufSize** – [in] Size of the input buffer in bytes, e.g. sizeof(EC_T_SET_MAILBOX_POLLING_CYCLES_DESC)
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
### struct EC_T_SET_MAILBOX_POLLING_CYCLES_DESC
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwSlaveId
[in] Slave Id
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wCycles
[in] Mailbox polling interval [ms]
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_MASTER_MAX_STATE
### EC_IOCTL_SET_MASTER_MAX_STATE
Set maximal master state. [emSetMasterState()](#db/d74/_ec_master_api_8cpp_1a4bedc33338cea3730b48340860bb5a21) returns with [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 the requested master state exceeds the maximal master state.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_STATE
* **dwInBufSize** – [in] Size of the input buffer in bytes, e.g. sizeof(EC_T_STATE)
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
#### SEE ALSO
- ### enum [EC_T_STATE](#_CPPv410EC_T_STATE)
- [`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_AUTO_ADJUST_MBX_STATE_COUNT_ENABLED
### EC_IOCTL_SET_AUTO_ADJUST_MBX_STATE_COUNT_ENABLED
This call specifies if the mailbox states count must be automatically adjusted according the mailbox state addresses in the ENI. This is needed if the ENI is inconsistent regarding the mailbox states, leading to Error 0x98130033 ENI: Inconsistent content. Default: Use ENI specified mailbox state count (EC_FALSE).
* **Parameters:**
* **pbyInBuf** – [in] Pointer to EC_T_BOOL
* **dwInBufSize** – [in] Size of the input buffer in bytes, e.g. sizeof(EC_T_BOOL)
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_ACTIVATE_VOE_RECV_FIFO
### EC_IOCTL_ACTIVATE_VOE_RECV_FIFO
Activates and set the size of the VoE receive FIFO.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to value of EC_T_WORD, size of the FIFO, use 0 to set it to the original size
* **dwInBufSize** – [in] Size of the input buffer in bytes, e.g. sizeof(EC_T_WORD)
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_SET_GEN_ENI_PARM
| Identifier | Description |
|---------------------------------|----------------------------------------------------------------------------------------|
| EC_GEN_ENI_PARM_ID_SLAVE_PREFIX | Prefix of SubDevices and their variables’ names. By default the prefix is ‘SubDevice’. |
### EC_IOCTL_SET_GEN_ENI_PARM
Change the behavior when the configuration of the EtherCAT network is generated according to a bus scan result of [emConfigureNetwork()](#db/d74/_ec_master_api_8cpp_1a94b249de63c121ccd694c834d820b1f2) with the parameter [eCnfType_GenPreopENI](#d0/d7a/_ec_interface_common_8h_1a31f4f87c29827f14776e5d1df7a8f637aad07f29bb292c6d95ea715590e7d747f) or [eCnfType_GenOpENI](#d0/d7a/_ec_interface_common_8h_1a31f4f87c29827f14776e5d1df7a8f637aeccdaf2f1fd20bd2f50ae9a51ad37818). In that case, default settings are taken to set e.g. the name of the EtherCAT slave device. The next table gives an overview about the possible parameters to be changed.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to struct [EC_T_SET_GEN_ENI_PARM](#dc/d89/struct_e_c___t___s_e_t___g_e_n___e_n_i___p_a_r_m)
* **dwInBufSize** – [in] Size of the input buffer in bytes, e.g. sizeof(EC_T_SET_GEN_ENI_PARM)
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
### struct EC_T_SET_GEN_ENI_PARM
### Public Members
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwParmId
ID of parameter to be set (EC_GEN_ENI_PARM_ID_…)
### [EC_T_GEN_ENI_PARM](#_CPPv417EC_T_GEN_ENI_PARM) GenEniParm
Value of parameter to be set
### union EC_T_GEN_ENI_PARM
### Public Members
### [EC_T_CHAR](toc_api.html.md#_CPPv49EC_T_CHAR) szSlaveNamePrefix[MAX_SHORT_STRLEN + 1]
### [EC_T_BOOL](toc_api.html.md#_CPPv49EC_T_BOOL) bIgnoreScanBusError
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wSlaveAddress
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)
## emIoCtl - EC_IOCTL_REALLOC_MBX_QUEUE
### EC_IOCTL_REALLOC_MBX_QUEUE
Reallocate the mailbox queues of the different mailbox protocols.
* **Parameters:**
* **pbyInBuf** – [in] Pointer to struct [EC_T_REALLOC_MBX_QUEUE_DESC](#d3/d09/struct_e_c___t___r_e_a_l_l_o_c___m_b_x___q_u_e_u_e___d_e_s_c)
* **dwInBufSize** – [in] Size of the input buffer in bytes, e.g. sizeof(EC_T_REALLOC_MBX_QUEUE_DESC)
* **pbyOutBuf** – [out] Should be set to EC_NULL
* **dwOutBufSize** – [in] Should be set to 0
* **pdwNumOutData** – [out] Should be set to EC_NULL
* **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
### struct EC_T_REALLOC_MBX_QUEUE_DESC
### Public Members
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wSlaveFixedAddress
Slave fixed address, 0 for all slaves
### [EC_T_WORD](toc_api.html.md#_CPPv49EC_T_WORD) wMbxProtocols
Combination of Mbx protocols EC_MBX_PROTOCOL_COE…
### [EC_T_DWORD](toc_api.html.md#_CPPv410EC_T_DWORD) dwMaxMbxTferQueued
Maximal number of transfers queued for the specified mailbox protocol of the specified slave
#### SEE ALSO
[`emIoCtl()`](#_CPPv47emIoCtl10EC_T_DWORD10EC_T_DWORDPCK9EC_T_VOID10EC_T_DWORDPC9EC_T_VOID10EC_T_DWORDPC10EC_T_DWORD)