6.3. General functions

6.3.1. emInitMaster

static EC_T_DWORD ecatInitMaster(const EC_T_INIT_MASTER_PARMS *pParms)
EC_T_DWORD emInitMaster(EC_T_DWORD dwInstanceID, const EC_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

struct EC_T_INIT_MASTER_PARMS

Public Members

EC_T_DWORD dwSignature

[in] Set to ATECAT_SIGNATURE

EC_T_DWORD dwSize

[in] Set to sizeof(EC_T_INIT_MASTER_PARMS)

EC_T_LOG_PARMS LogParms

[in] Logging parameters

EC_T_OS_PARMS *pOsParms

[in] OS layer parameters

EC_T_LINK_PARMS *pLinkParms

[in] Link layer parameters

EC_T_LINK_PARMS *pLinkParmsRed

[in] Link layer parameters for red device (cable redundancy)

EC_T_DWORD dwBusCycleTimeNsec

[in] Bus cycle time [ns]

EC_T_DWORD dwMaxBusSlaves

[in] Maximum pre-allocated bus slave objects ( default: 256 )

EC_T_DWORD dwMaxAcycFramesQueued

[in] Maximum queued acyclic frames

EC_T_DWORD dwAdditionalEoEEndpoints

[in] Additional EoE endpoints

EC_T_DWORD dwMaxAcycBytesPerCycle

[in] Maximum bytes sent during eUsrJob_SendAcycFrames per cycle ( default: 4096 )

EC_T_DWORD dwMaxAcycFramesPerCycle

[in] Maximum frames sent during eUsrJob_SendAcycFrames per cycle ( default: 32 )

EC_T_DWORD dwMaxAcycCmdsPerCycle

[in] Maximum commands sent during eUsrJob_SendAcycFrames per cycle ( default: 124 )

EC_T_DWORD dwMaxSlavesProcessedPerCycle

[in] Maximum slave-related state machine calls per cycle (default = all)

EC_T_DWORD dwEcatCmdMaxRetries

[in] Maximum retries to send pending EtherCAT command frames ( default: 3 )

EC_T_DWORD dwEcatCmdTimeout

[in] Timeout [ms] to send pending EtherCAT command frames ( default: 3 * bus cycle time, at least 2 ms )

EC_T_BOOL bReserved

[in] bVLANEnable: obsolete

EC_T_WORD wReserved

[in] wVLANId: obsolete

EC_T_BYTE byReserved

[in] byVLANPrio: obsolete

EC_T_MASTER_RED_PARMS MasterRedParms

[in] Master Redundancy parameters

EC_T_DWORD dwMaxS2SMbxSize

[in] Size of the queued S2S mailbox in bytes ( default: 0 )

EC_T_DWORD dwMaxQueuedS2SMbxTfer

[in] S2S Fifo number of entries ( default: 0 )

EC_T_WORD wMaxSlavesProcessedPerBusScanStep

[in] Maximum slave-related calls per cycle during bus scans (default = all)

EC_T_BOOL bApiLockByApp

[in] Lock pending API against emDeinitMaster(). EC_FALSE (default): locked internally. EC_TRUE: application is responsible for locking.

EC_T_PERF_MEAS_INTERNAL_PARMS PerfMeasInternalParms

[in] Internal performance measurement parameters

EC_T_BOOL bNoConsecutiveAcycFrames

[in] EC_FALSE(default) : 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 dwSignature

[in] Set to EC_OS_PARMS_SIGNATURE

EC_T_DWORD dwSize

[in] Set to sizeof(EC_T_OS_PARMS)

EC_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 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 dwLogLevel

[in] Log level. See EC_LOG_LEVEL…

EC_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 (*EC_PF_LOGMSGHK)(EC_T_LOG_CONTEXT *pContext, EC_T_DWORD dwLogMsgSeverity, const EC_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 or error code

Log messages are passed from the EC-Master to the callback given at EC_T_LOG_PARMS::pfLogMsg. 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. E.g. messages of severity EC_LOG_LEVEL_WARNING are not passed to the application if EC_T_LOG_PARMS::dwLogLevel is set to EC_LOG_LEVEL_ERROR.

The application can provide customized log message handlers of type EC_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 bEnabled

[in] Enable/disable internal performance counters

EC_T_PERF_MEAS_COUNTER_PARMS CounterParms

[in] Timer function settings. When not provided OsMeasGetCounterTicks is used.

EC_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 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 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

6.3.2. emDeinitMaster

static EC_T_DWORD ecatDeinitMaster(EC_T_VOID)
EC_T_DWORD emDeinitMaster(EC_T_DWORD dwInstanceID)

Deinitialize EC-Master.

Waits for pending API calls if emInitMaster() was called with EC_T_INIT_MASTER_PARMS::bApiLockByApp = EC_FALSE (default).

Parameters

dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)

Returns

EC_E_NOERROR or error code

6.3.3. emGetMasterParms

static EC_T_DWORD ecatGetMasterParms(EC_T_INIT_MASTER_PARMS *pParms, EC_T_DWORD dwParmsBufSize)
EC_T_DWORD emGetMasterParms(EC_T_DWORD dwInstanceID, EC_T_INIT_MASTER_PARMS *pParms, EC_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, the parameters of EC_T_INIT_MASTER_PARMS.pOsParms, EC_T_INIT_MASTER_PARMS.pLinkParms and EC_T_INIT_MASTER_PARMS.pLinkParmsRed 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

emGetMasterParms() Example
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()

6.3.4. emSetMasterParms

static EC_T_DWORD ecatSetMasterParms(const EC_T_INIT_MASTER_PARMS *pParms)
EC_T_DWORD emSetMasterParms(EC_T_DWORD dwInstanceID, const EC_T_INIT_MASTER_PARMS *pParms)

Change Master initialization parameters.

Currently the following parameters cannot be changed:

Parameters
  • dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)

  • pParms – [in] New Master parameters

Returns

emSetMasterParms() Example
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()

6.3.5. emScanBus

static EC_T_DWORD ecatScanBus(EC_T_DWORD dwTimeout)
EC_T_DWORD emScanBus(EC_T_DWORD dwInstanceID, EC_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

emScanBus() Example
dwRes = emScanBus(dwInstanceId, 5000 /* timeout */);

6.3.6. emRescueScan

static EC_T_DWORD ecatRescueScan(EC_T_DWORD dwTimeout)
EC_T_DWORD emRescueScan(EC_T_DWORD dwInstanceID, EC_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 or error code

emRescueScan() Example
dwRes = emRescueScan(dwInstanceId, 5000 /* timeout */);

6.3.7. emConfigureNetwork

static EC_T_DWORD ecatConfigureNetwork(EC_T_CNF_TYPE eCnfType, EC_T_PBYTE pbyCnfData, EC_T_DWORD dwCnfDataLen)
EC_T_DWORD emConfigureNetwork(EC_T_DWORD dwInstanceID, EC_T_CNF_TYPE eCnfType, EC_T_PBYTE pbyCnfData, EC_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

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

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 pfnFileOpen

[in] Function pointer called instead of OsCfgFileOpen()

EC_PF_CNF_CLOSE pfnFileClose

[in] Function pointer called instead of OsCfgFileClose()

EC_PF_CNF_READ pfnFileRead

[in] Function pointer called instead of OsCfgFileRead()

EC_PF_CNF_ERROR pfnFileError

[in] Function pointer called instead of OsCfgFileError()

EC_PF_CNF_EOF pfnFileEof

[in] Function pointer called instead of OsCfgFileEof()

typedef EC_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 or error code

typedef EC_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 or error code

typedef EC_T_DWORD (*EC_PF_CNF_READ)(EC_T_VOID *pvContext, EC_T_BYTE *pbyReadData, EC_T_DWORD dwReadLen, EC_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 or error code

typedef EC_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 or error code

typedef EC_T_DWORD (*EC_PF_CNF_EOF)(EC_T_VOID *pvContext, EC_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 or error code

emConfigureNetwork() Example
/* load ENI */
const EC_T_CHAR* szFileName = "eni.xml";
dwRes = emConfigureNetwork(dwInstanceId, eCnfType_Filename,
    (EC_T_BYTE*)szFileName, (EC_T_DWORD)OsStrlen(szFileName));

6.3.8. emConfigGet

static EC_T_DWORD ecatConfigGet(EC_T_BYTE **ppbyCnfData, EC_T_DWORD *pdwCnfDataLen)
EC_T_DWORD emConfigGet(EC_T_DWORD dwInstanceID, EC_T_BYTE **ppbyCnfData, EC_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 or error code

emConfigGet() Example
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;
}

6.3.9. 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 ecatConfigExtend(EC_T_BOOL bResetConfig, EC_T_DWORD dwTimeout)
EC_T_DWORD emConfigExtend(EC_T_DWORD dwInstanceID, EC_T_BOOL bResetConfig, EC_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 or error code

emConfigExtend() Example
dwRes = emConfigExtend(dwInstanceId, EC_TRUE, 5000 /* timeout */);

6.3.10. emRegisterClient

static EC_T_DWORD ecatRegisterClient(EC_PF_NOTIFY pfnNotify, EC_T_VOID *pCallerData, EC_T_REGISTERRESULTS *pRegResults)
EC_T_DWORD emRegisterClient(EC_T_DWORD dwInstanceID, EC_PF_NOTIFY pfnNotify, EC_T_VOID *pCallerData, EC_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

Returns

typedef EC_T_DWORD (*EC_PF_NOTIFY)(EC_T_DWORD dwCode, EC_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 dwClntId

[out] Client ID

EC_T_BYTE *pbyPDIn

[out] Pointer to process data input memory

EC_T_DWORD dwPDInSize

[out] Size of process data input memory (in bytes)

EC_T_BYTE *pbyPDOut

[out] Pointer to process data output memory

EC_T_DWORD dwPDOutSize

[out] Size of process data output memory (in bytes)

emRegisterClient() Example
EC_T_REGISTERRESULTS oRegResults;
OsMemset(&oRegResults, 0, sizeof(EC_T_REGISTERRESULTS));
dwRes = emRegisterClient(dwInstanceId, myAppNotify, pvMyAppContext, &oRegResults);

6.3.11. emUnregisterClient

static EC_T_DWORD ecatUnregisterClient(EC_T_DWORD dwClntId)
EC_T_DWORD emUnregisterClient(EC_T_DWORD dwInstanceID, EC_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 or error code

6.3.12. emGetSrcMacAddress

static EC_T_DWORD ecatGetSrcMacAddress(ETHERNET_ADDRESS *pMacSrc)
EC_T_DWORD emGetSrcMacAddress(EC_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 or error code

emGetSrcMacAddress() Example
/* get MAC address of EtherCAT network adapter */
ETHERNET_ADDRESS oMacSrc;
OsMemset(&oMacSrc, 0, sizeof(ETHERNET_ADDRESS));
dwRes = emGetSrcMacAddress(dwInstanceId, &oMacSrc);

6.3.13. emSetMasterState

static EC_T_DWORD ecatSetMasterState(EC_T_DWORD dwTimeout, EC_T_STATE eReqState)
EC_T_DWORD emSetMasterState(EC_T_DWORD dwInstanceID, EC_T_DWORD dwTimeout, EC_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

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
/* set EtherCAT master (and all slaves) into requested state */
dwRes = emSetMasterState(dwInstanceId, 5000, eEcatState_PREOP);

6.3.14. emSetMasterStateReq

static EC_T_DWORD ecatSetMasterStateReq(EC_T_DWORD dwTimeout, EC_T_STATE eReqState)
EC_T_DWORD emSetMasterStateReq(EC_T_DWORD dwInstanceID, EC_T_DWORD dwTimeout, EC_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

emSetMasterStateReq() Example
/* set EtherCAT master (and all slaves) into requested state */
dwRes = emSetMasterStateReq(dwInstanceId, 5000, eEcatState_PREOP);

6.3.15. emGetMasterState

static EC_T_STATE ecatGetMasterState(EC_T_VOID)
EC_T_STATE emGetMasterState(EC_T_DWORD dwInstanceID)

Get the EtherCAT master current state.

Parameters

dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)

Returns

EtherCAT master state

emGetMasterState() Example
EC_T_STATE eMasterState = emGetMasterState(dwInstanceId);
EcLogMsg(EC_LOG_LEVEL_INFO, (pEcLogContext, EC_LOG_LEVEL_INFO,
    "Current Master State: %s:\n", ecatStateToStr(eMasterState)));

6.3.16. emGetMasterStateEx

static EC_T_DWORD ecatGetMasterStateEx(EC_T_WORD *pwCurrState, EC_T_WORD *pwReqState)
EC_T_DWORD emGetMasterStateEx(EC_T_DWORD dwInstanceID, EC_T_WORD *pwCurrState, EC_T_WORD *pwReqState)

Get the EtherCAT master current and requested state. Possible return values for current and requested state:

Parameters
  • dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)

  • pwCurrState – [out] Current master state

  • pwReqState – [out] Requested master state

Returns

emGetMasterStateEx() Example
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)));

6.3.17. emExecJob

static EC_T_DWORD ecatExecJob(EC_T_USER_JOB eUserJob, EC_T_USER_JOB_PARMS *pUserJobParms)
EC_T_DWORD emExecJob(EC_T_DWORD dwInstanceID, EC_T_USER_JOB eUserJob, EC_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

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 bAllCycFramesProcessed
EC_T_DWORD dwNumFramesSent
EC_T_DWORD dwTaskIdToSend
struct EC_T_USER_JOB_PARMS::_SEND_CYCFRAME_BY_TASKID SendCycFramesByTaskId
struct EC_T_USER_JOB_PARMS::_PROCESS_RXFRAME_BY_TASKID ProcessRxFramesByTaskId
struct EC_T_USER_JOB_PARMS::_SWITCH_EOE_FRAMES SwitchEoeFrames
struct EC_T_USER_JOB_PARMS::_START_TASK StartTask
struct EC_T_USER_JOB_PARMS::_STOP_TASK StopTask
struct _PROCESS_RXFRAME_BY_TASKID

Public Members

EC_T_BOOL bCycFramesProcessed
EC_T_DWORD dwTaskId
struct _SEND_CYCFRAME_BY_TASKID

Public Members

EC_T_DWORD dwTaskId
struct _START_TASK

Public Members

EC_T_DWORD dwTaskId
struct _STOP_TASK

Public Members

EC_T_DWORD dwTaskId
struct _SWITCH_EOE_FRAMES

Public Members

EC_T_DWORD dwMaxPortsToProcess
EC_T_DWORD dwNumFramesProcessed

Detailed job description:

  1. eUsrJob_ProcessAllRxFrames

    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.

    pUserJobParms->bAllCycFramesProcessed
    

    If this flag is set to a value of EC_TRUE it indicates that all previously initiated cyclic frames ( eUsrJob_SendAllCycFrames ) are received and processed within this call. Not used if pUserJobParms is set to EC_NULL.

    Return: EC_E_NOERROR if successful, error code in case of failures.

  2. eUsrJob_SendAllCycFrames

    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() with the eUsrJob_ProcessAllRxFrames job will check for received frames and update the process data input values.

    pUserJobParms->dwNumFramesSent
    

    Indicates number of frames sent within this call. Not used if pUserJobParms is set to EC_NULL.

    Return: 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).

  3. eUsrJob_SendAcycFrames

    Acyclic EtherCAT® datagrams stored in the acyclic frame buffer FIFO will be sent when executing this call.

    pUserJobParms->dwNumFramesSent
    

    Indicates number of frames sent within this call. Not used if pUserJobParms is set to EC_NULL.

    Return: EC_E_NOERROR if successful, error code in case of failures.

  4. eUsrJob_MasterTimer

    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() ( eUsrJob_MasterTimer). The state-machines are handling the EtherCAT® state change transfers.

    Return: EC_E_NOERROR if successful, error code in case of failures.

  5. eUsrJob_SendCycFramesByTaskId

    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.

    pUserJobParms->SendCycFramesByTaskId.dwTaskId
    

    Task id.

    Return: 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).

  6. eUsrJob_ProcessRxFramesByTaskId

    eUsrJob_ProcessAcycRxFrames

    See also

    Feature-Pack Split Frame Processing

  7. eUsrJob_SwitchEoeFrames

    This job must be called if 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

    pUserJobParms->SwitchEoeFrames.dwMaxPortsToProcess
    

    Indicates number of ports to be processed within this call. If zero, all ports will be processed.

    pUserJobParms->SwitchEoeFrames.dwNumFramesProcessed
    

    Returns number of frames processed within this call.

    Return: EC_E_NOERROR if successful

  8. eUsrJob_StartTask

    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

    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
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);

6.3.18. emGetVersion

static EC_T_DWORD ecatGetVersion(EC_T_DWORD *pdwVersion, EC_T_DWORD *pdwVersionType)
EC_T_DWORD emGetVersion(EC_T_DWORD dwInstanceID, EC_T_DWORD *pdwVersion, EC_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.

Returns

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
/* get stack version */
EC_T_DWORD dwVersion = EC_E_ERROR;
EC_T_DWORD dwVersionType = 0;
dwRes = emGetVersion(dwInstanceId, &dwVersion, &dwVersionType);

6.3.19. emSetLicenseKey

static EC_T_DWORD ecatSetLicenseKey(const EC_T_CHAR *szLicenseKey)
EC_T_DWORD emSetLicenseKey(EC_T_DWORD dwInstanceID, const EC_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

emSetLicenseKey() Example
dwRes = emSetLicenseKey(dwInstanceId, "DA1099F2-15C249E9-54327FBC");

6.3.20. emSetOemKey

static EC_T_DWORD ecatSetOemKey(EC_T_UINT64 qwOemKey)
static EC_T_DWORD emSetOemKey(EC_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
dwRes = emSetOemKey(dwInstanceId, 0x1234567812345678);

6.3.21. emIoCtl

static EC_T_DWORD ecatIoCtl(EC_T_DWORD dwCode, const EC_T_VOID *const pbyInBuf, EC_T_DWORD dwInBufSize, EC_T_VOID *const pbyOutBuf, EC_T_DWORD dwOutBufSize, EC_T_DWORD *const pdwNumOutData)
EC_T_DWORD emIoCtl(EC_T_DWORD dwInstanceID, EC_T_DWORD dwCode, const EC_T_VOID *const pbyInBuf, EC_T_DWORD dwInBufSize, EC_T_VOID *const pbyOutBuf, EC_T_DWORD dwOutBufSize, EC_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

6.3.22. 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)

  • 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 or error code

struct EC_T_MEMREQ_DESC

Public Members

EC_T_DWORD dwPDOutSize

Size of the output process data image

EC_T_DWORD dwPDInSize

Size of the input process data image

See also

emIoCtl()

6.3.23. 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 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)

  • 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 or error code

struct EC_T_MEMPROV_DESC

Public Members

EC_T_PVOID pvContext

Context pointer. This pointer is used every time one of the callback functions (e.g. pfPDOutReadRequest) is called.

EC_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 is called.

EC_T_DWORD dwPDOutDataLength

Length of the output process data buffer

EC_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 is called.

EC_T_DWORD dwPDInDataLength

Length of the input process data buffer

EC_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 is used.

EC_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 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 is used.

EC_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 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 is used.

EC_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 pbyMasterRedPDOutData

Pointer to the MasterRed output process data buffer (ACTIVE to INACTIVE)

EC_T_DWORD dwMasterRedPDOutDataLength

Length of the MasterRed output process data buffer

EC_T_PBYTE pbyMasterRedPDInData

Pointer to the default input process data buffer (INACTIVE to ACTIVE)

EC_T_DWORD dwMasterRedPDInDataLength

Length of the input process data buffer

EC_T_PFMEMREQ pfMasterRedPDOutReadRequest

This function will be called within the process data transfer cycle prior to reading data

EC_T_PFMEMREL pfMasterRedPDOutReadRelease

This function will be called after all data has been read from the output process data buffer

EC_T_PFMEMREQ pfMasterRedPDOutWriteRequest

This function will be called within the process data transfer cycle prior to reading data

EC_T_PFMEMREL pfMasterRedPDOutWriteRelease

This function will be called after all data were read from the output process data buffer

EC_T_PFMEMREQ pfMasterRedPDInWriteRequest

This function will be called within the process data transfer cycle prior to writing data

EC_T_PFMEMREL pfMasterRedPDInWriteRelease

This function will be called after all data were written to the input process data buffer

EC_T_PFMEMREQ pfMasterRedPDInReadRequest

This function will be called within the process data transfer cycle prior to writing data

EC_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 pvContext, EC_T_DWORD dwTaskId, EC_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 is used. The provided buffer size must correspond to the caller context.

typedef EC_T_VOID (*EC_T_PFMEMREL)(EC_T_PVOID pvContext, EC_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

6.3.24. 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)

  • 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 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 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 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()

6.3.26. 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

  • 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 or error code

struct EC_T_LINKLAYER_MODE_DESC

Public Members

EC_T_LINKMODE eLinkMode

[out] Operation mode of main interface

EC_T_LINKMODE eLinkModeRed

[out] Operation mode of redundancy interface

See also

emIoCtl()

6.3.27. 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 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 or error code

struct EC_T_CYC_CONFIG_DESC

Public Members

EC_T_DWORD dwNumCycEntries

[out] Total number of cyclic entries

EC_T_DWORD dwTaskId

[out] Task ID of selected cyclic entry (ENI: Cyclic/TaskId)

EC_T_DWORD dwPriority

[out] Priority of selected cyclic entry

EC_T_DWORD dwCycleTime

[out] Cycle time of selected cyclic entry

See also

emIoCtl()

6.3.28. 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 or error code

See also

emIoCtl()

6.3.29. 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.

EC_T_DWORD dwCode = (EC_IOCTL_LINKLAYER_MAIN | EC_LINKIOCTL_GET_ETHERNET_ADDRESS);

See also

emIoCtl()

6.3.30. 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()

6.3.31. 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()

6.3.32. 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 Location

PCI location (bus, device, function)

EC_T_PCI_INFO_IDENIFICATION Ident

PCI identification (vendor id, device id)

EC_T_DWORD dwIoBarCnt

I/O bar count

EC_T_PCI_INFO_IOBAR aIoBar

PCI I/O bars info

EC_T_DWORD dwMemBarCnt

Memory bar count

EC_T_PCI_INFO_MEMBAR aMemBar

PCI Memory bars info

EC_T_DWORD dwInterruptCnt

IRQ count

EC_T_PCI_INFO_INTERRUPT aInterrupt

PCI IRQ info

EC_T_DWORD adwReserved[16]

Reserved for future use

struct EC_T_PCI_INFO_LOCATION

Public Members

EC_T_DWORD dwDomainNumber

Domain

EC_T_DWORD dwBusNumber

Bus number

EC_T_DWORD dwDeviceNumber

Device number

EC_T_DWORD dwFunctionNumber

Function number

struct EC_T_PCI_INFO_IDENIFICATION

Public Members

EC_T_DWORD dwVendorId

Vendor ID

EC_T_DWORD dwDeviceId

Device ID

EC_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 dwLen

Bar length

EC_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 dwLen

Bar length

EC_T_DWORD dwReserved

Reserved for future use

struct EC_T_PCI_INFO_INTERRUPT

Public Members

EC_T_DWORD dwIrq

IRQ number

EC_T_CPUSET CpuAffinity

Reserved for future use

EC_T_DWORD adwReserved[2]

Reserved for future use

See also

emIoCtl()

6.3.33. 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 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 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()

6.3.34. 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

  • 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 or error code

struct EC_T_MASTERDEFAULTTIMEOUTS_DESC

Public Members

EC_T_DWORD dwMasterStateChange

Default state change timeout [ms], applied if emSetMasterState called with EC_NOWAIT

EC_T_DWORD dwInitCmdRetry

Timeout [ms] between retry sending an init-command

EC_T_DWORD dwMbxCmd

Timeout [ms] between retry sending an mailbox command

EC_T_DWORD dwMbxPolling

Mailbox polling cycle [ms] ( default: 10 ms )

EC_T_DWORD dwDcmInSync

Timeout [ms] to wait for DCM InSync in state change PREOP to SAFEOP ( default: infinite )

EC_T_WORD wInitCmd

Timeout [ms] to InitCmds if not specified in ENI ( default: 1100 ms )

EC_T_DWORD dwSlaveIdentification

Timeout [ms] to wait for the reading of the slave identification ( default: 5000 )

EC_T_DWORD dwGenerateEni

Timeout [ms] to wait for eCnfType_GenPreopENI, eCnfType_GenOpENI, eCnfType_Gen… ( default: 30000 ms )

EC_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.

6.3.35. emIoCtl - EC_IOCTL_SET_COPYINFO_IN_SENDCYCFRAMES

EC_IOCTL_SET_COPYINFO_IN_SENDCYCFRAMES

Set copy info processed in either eUsrJob_SendAllCycFrames or in eUsrJob_ProcessAllRxFrames.

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 or error code

Default: Set by ProcessAllRxFrames.

See also

emIoCtl()

6.3.36. emIoCtl - EC_IOCTL_SET_BUS_CYCLE_TIME

EC_IOCTL_SET_BUS_CYCLE_TIME

Set bus cycle time [us] master parameter without calling emInitMaster() 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 or error code

Implicitly recalculates Order Timeout and EC_T_INIT_MASTER_PARMS::dwEcatCmdTimeout.

See also

emIoCtl()

6.3.37. 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 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()

6.3.38. 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 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()

6.3.39. 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 or error code

Calling this IOCTL with 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 is generated and the application must consider this status for the current cycle.

See also

emIoCtl()

6.3.40. 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 or error code

Calling this IOCTL with 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 is generated and the application must consider this status for the current cycle.

See also

emIoCtl()

6.3.41. 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 or error code

Calling this IOCTL with 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 is generated and the application must consider this status for the current cycle.

6.3.42. 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 or error code

Calling this IOCTL with 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()

6.3.43. 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 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()

6.3.44. 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 or error code

Enabling deferred EoE switching reduces the CPU load of JOB_ProcessAllRxFrames in case of EoE communication. eUsrJob_SwitchEoeFrames has to be called explicitly to switch the received EoE frames between the EoE SubDevices and EoE end point(s).

See also

emIoCtl()

6.3.45. 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

  • 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 or error code

struct EC_T_SET_MAILBOX_POLLING_CYCLES_DESC

Public Members

EC_T_DWORD dwSlaveId

[in] Slave Id

EC_T_WORD wCycles

[in] Mailbox polling interval [ms]

See also

emIoCtl()

6.3.46. emIoCtl - EC_IOCTL_SET_MASTER_MAX_STATE

EC_IOCTL_SET_MASTER_MAX_STATE

Set maximal master state. emSetMasterState() returns with EC_E_INVALIDSTATE 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 or error code

See also

6.3.47. 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 or error code

See also

emIoCtl()

6.3.48. 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 or error code

See also

emIoCtl()

6.3.49. 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 ‘Slave’.

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() with the parameter eCnfType_GenPreopENI or eCnfType_GenOpENI. 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

  • 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 or error code

struct EC_T_SET_GEN_ENI_PARM

Public Members

EC_T_DWORD dwParmId

ID of parameter to be set (EC_GEN_ENI_PARM_ID_…)

EC_T_GEN_ENI_PARM GenEniParm

Value of parameter to be set

union EC_T_GEN_ENI_PARM

Public Members

EC_T_CHAR szSlaveNamePrefix[MAX_SHORT_STRLEN + 1]
EC_T_BOOL bIgnoreScanBusError
EC_T_WORD wSlaveAddress

See also

emIoCtl()

6.3.50. 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

  • 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 or error code

struct EC_T_REALLOC_MBX_QUEUE_DESC

Public Members

EC_T_WORD wSlaveFixedAddress

Slave fixed address, 0 for all slaves

EC_T_WORD wMbxProtocols

Combination of Mbx protocols EC_MBX_PROTOCOL_COE…

EC_T_DWORD dwMaxMbxTferQueued

Maximal number of transfers queued for the specified mailbox protocol of the specified slave

See also

emIoCtl()