3.1. CEcWrapperDotNet
- class EcWrapperDotNet.CEcWrapperDotNet : IDisposable
Subclassed by EcWrapperDotNet.CEcMasterMbxGatewayClientDotNet, EcWrapperDotNet.CEcMasterMbxGatewayServerDotNet, EcWrapperDotNet.CEcMasterRasServerDotNet, EcWrapperDotNet.CEcMonitorDotNet, EcWrapperDotNet.CEcMonitorRasServerDotNet, EcWrapperDotNet.CEcRasClientDotNet, EcWrapperDotNet.CEcSimulatorDotNet, EcWrapperDotNet.CEcSimulatorRasServerDotNet, EcWrapperDotNet.CEcWrapperDotNetEx
Public Functions
- void Dispose ()
summary> Throws the EtherCAT-Notifications. The Type of the event depends on the notification code.
- ECError SetCycFrameRxCallback (CycFrameRxCallback pfnCallback)
Set cyclic frame RX callback function.
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.
- Param pfnCallback:
Callback function
- Return:
EC_E_NOERROR or error code
- ECError RegisterClient (out DN_EC_T_REGISTERRESULTS pRegRes)
Register a client with the EtherCAT Master.
- Param pRegRes:
out Registration results, a pointer to a structure of type REGISTERRESULTS
- Return:
Error Code
- ECError UnregisterClient ()
Unregister a client from the EtherCAT master.
- Return:
Error code
- ECError DcmGetLog (out string pszLog)
Get logging information from the DCM controller.
- Return:
Error code
- ECError RasGetConnectionInfo (out DN_EC_T_RAS_CONNECTION_INFO pConInfo)
Get actual connection information /summary>
- param pConInfo:
connection information
- return:
EC_E_NOERROR on success, otherwise an error code.
- ECError MbxGatewayCoeSdoDownload (ushort wAddress, ushort wObIndex, byte byObSubIndex, byte[] pbyData, uint dwDataLen, uint dwTimeout, uint dwFlags)
Initiate CoE SDO download transfer to mailbox gateway server.
- Param wAddress:
slave address to download the SDO
- Param wObIndex:
object index
- Param byObSubIndex:
object sub-index
- Param pbyData:
- Param dwDataLen:
- Param dwTimeout:
Timeout in milliseconds
- Param dwFlags:
mailbox transfer flags
- Return:
Depends on the implementation of the function OsSetLastError(), normally returns EC_E_NOERROR if it succeeds or error code if it fails
- ECError MbxGatewayCoeSdoUpload (ushort wAddress, ushort wObIndex, byte byObSubIndex, byte[] pbyData, uint dwDataLen, out uint pdwOutDataLen, uint dwTimeout, uint dwFlags)
Initiate CoE SDO upload transfer from mailbox gateway server.
- Param wAddress:
slave address to upload the SDO
- Param wObIndex:
object index
- Param byObSubIndex:
object sub-index
- Param pbyData:
- Param dwDataLen:
- Param pdwOutDataLen:
- Param dwTimeout:
Timeout in milliseconds
- Param dwFlags:
mailbox transfer flags, see EC_MAILBOX_FLAG
- Return:
Depends on the implementation of the function OsSetLastError(), normally returns EC_E_NOERROR if it succeeds or error code if it fails
- void EnablePerformanceMeasuring (bool bEnable)
Enables performance monitoring. For every master function, the notification “PerfNotification” will be called.
- Param bEnable:
True = Enables performance monitoring
- void EnableTranslation (bool bEnable)
Enables translation. For every master string, the notification “TranslateNotification” will be called.
- Param bEnable:
True = Enables translation
- ECError OptimizeProcessPerformance ()
Optimize process performance.
- Return:
EC_E_NOERROR on success, otherwise an error code.
- String GetErrorText (ECError eErrorCode)
Return text tokens by Error code from master stack.
- Param eErrorCode:
Error code
- Return:
Error text for supplied error code
- ECError ConfigureNetwork (FileInfo oConfigFile)
Configure the Master
- param oConfigFile:
File with configuration parameters
- Return:
Error code
- ECError ConfigureNetwork (DN_EC_T_CNF_TYPE tConfigType, Stream oConfigData)
Configure the Master
- param tConfigType:
Enum type of configuration data provided
- param oConfigData:
Configuration data (stream)
- Return:
Error code
- ECError ExecJob (DN_EC_T_USER_JOB eUserJob)
Execute or initiate the requested master job.
- Param eUserJob:
Requested job.
- Return:
Error code
- ECError ExecJobProcessAllRxFrames (out bool bPrevCycProcessed)
calls the process all rx frame job
- Param bPrevCycProcessed:
true: previous send frame was received and processed, false: otherwise
- Return:
EC_NOERROR or error code
- ECError ExecJobProcessAllRxFrames ()
calls the process all rx frame job
- Return:
EC_NOERROR or error code
- ECError ExecJobSendCycFramesByTaskId (UInt32 dwTaskId)
sends a cycle frame by its task id
- Param dwTaskId:
task id of the cyclic frame
- Return:
EC_NOERROR or error code
- string ConvertMasterStringFromBytes (byte[] abyData, int dwOffset, int dwLen)
Converts a master string into UTF8 format.
- Param abyData:
Byte array to convert
- Param dwOffset:
Offset
- Param dwLen:
Length
- Return:
Converted string
- string ConvertMasterString (String val)
Converts a master string into UTF8 format.
- Param val:
String to convert.
- Return:
Converted string.
- ECError EoeInstallEndpoint (bool bCreateTxEvent, String strInterfaceName, String strInterfaceGuid)
Install EoE endpoint.
- Param bCreateTxEvent:
Create TX Event
- Param strInterfaceName:
Interface name (optional)
- Param strInterfaceGuid:
Interface guid (optional)
- Return:
Error code
- ECError EoeUninstallEndpoint ()
Uninstall EoE endpoint.
- Return:
Error code
- ECError EoeTriggerTxEvent ()
Trigger TX Event, which must be called from JobTask after ExecJobProcessAllRxFrames()
- Return:
Error code
- string ESCTypeText (byte byEscType, bool bLong)
Gets the text of corresponding ESC type.
- Param byEscType:
ESC type
- Param bLong:
true: long text version, false: short text version
- Return:
Text of corresponding ESC type
- string SlaveVendorText (uint dwVendorId)
Gets the text of slave vendor.
- Param dwVendorId:
Vendor ID
- Return:
Text of slave vendor
- string SlaveProdCodeText (uint dwVendorId, uint dwProductCode)
Gets the text of slave product code.
- Param dwVendorId:
Vendor ID
- Param dwProductCode:
Product code
- Return:
Text of slave product code
- ECError SetBusCnfReadProp (DN_ESC_SII_REG eEscSiiReg, uint dwTimeout)
Sets read property for bus configuration.
- Param eEscSiiReg:
SII register
- Param dwTimeout:
Time out of bus scan
- Return:
Error code
- ECError RestartScanBus (uint dwTimeout, bool bReadRevisionNo, bool bReadSerialNo)
Trigger Bus Scan.
- Param dwTimeout:
Time out of bus scan
- Param bReadRevisionNo:
Read revision number
- Param bReadSerialNo:
Read serial number
- Return:
Error code
- ECError GetBusScanSlaveInfoDesc (short wAutoIncAddr, out DN_EC_T_SB_SLAVEINFO_DESC oSlaveInfoDesc)
This call will return the basic slave info determined in the last bus scan.
- Param wAutoIncAddr:
Auto increment address of the slave
- Param oSlaveInfoDesc:
Out parameter that contains different slave information after the call
- Return:
Error code
- ECError GetScanBusStatus (out DN_EC_T_SB_STATUS_NTFY_DESC oSbStatus)
Gets the status of the last bus scan.
- Param oSbStatus:
The last bus scan status
- Return:
Error code
- ECError CoeGetODList (UInt32 dwSlaveId, DN_EC_T_COE_ODLIST_TYPE eListType, out UInt16[] pList, UInt32 dwLen, out UInt32 pdwOutLen, UInt32 dwTimeout)
Gets a list of object Ids that are available in a slave.
- Param dwSlaveId:
slave ID
- Param eListType:
Object list type. eODListType_ALL: Get all objects eODListType_RxPdoMap: Get PDO mappable objects eODListType_TxPdoMap: Get objects that can be changed eODListType_StoredFRepl: Get objects that are stored for a device replacement eODListType_StartupParm: Get objects that can be used as startup parameter
- Param pList:
out Filled OD list
- Param dwLen:
Length of list
- Param pdwOutLen:
out Length of output list
- Param dwTimeout:
Timeout
- Return:
Error code
- ECError CoeGetObjectDesc (UInt32 dwSlaveId, UInt16 wIndex, out DN_EC_T_COE_OBDESC oObjDesc, UInt32 dwTimeout)
Determines the description of a specific object.
- Param dwSlaveId:
slave ID
- Param wIndex:
Object index
- Param oObjDesc:
out Description of a specific object
- Param dwTimeout:
Timeout
- Return:
Error code
- ECError CoeGetEntryDesc (UInt32 dwSlaveId, UInt16 wIndex, Byte bySubIndex, Byte byValueInfoType, out DN_EC_T_COE_ENTRYDESC oEntryDesc, UInt32 dwTimeout)
Determines the description of a specific object entry.
- Param dwSlaveId:
slave ID
- Param wIndex:
Object index
- Param bySubIndex:
Object subindex
- Param byValueInfoType:
Bit mask to define which information to determine. The bit values are defined as follows: EC_COE_ENTRY_ObjAccess - Object access rights EC_COE_ENTRY_ObjCategory - Object category EC_COE_ENTRY_PdoMapping - Information if the object is PDO mappable EC_COE_ENTRY_UnitType - Unit EC_COE_ENTRY_DefaultValue - Default value EC_COE_ENTRY_MinValue - Minimum value EC_COE_ENTRY_MaxValue - Maximum value
- Param oEntryDesc:
out Description of a specific object entry
- Param dwTimeout:
Timeout
- Return:
Error code
- ECError MbxTferCreate (UInt32 dwTferId, UInt32 dwBufferSize, out IntPtr pMbxTfer)
Creates a mailbox transfer object.
- Param dwTferId:
transfer ID (optional, can be 0)
- Param dwBufferSize:
buffer size
- Param pMbxTfer:
out mailbox transfer object
- Return:
Error code
- ECError MbxTferReset (IntPtr pMbxTfer)
Creates a mailbox transfer object.
- Param pMbxTfer:
mailbox transfer object
- Return:
Error code
- void MbxTferDelete (IntPtr pMbxTfer)
Deletes a mailbox transfer object.
A transfer object may only be deleted if it is in the Idle state.
- Param pMbxTfer:
Mailbox transfer object created with emMbxTferCreate
- ECError MbxTferWait (IntPtr pMbxTfer)
Waits until mailbox transfer is finished.
- Param pMbxTfer:
mailbox transfer object
- Return:
Error code
- ECError MbxTferCopyTo (IntPtr pMbxTfer, byte[] abyData, UInt32 dwDataLen)
Copies data to the mailbox transfer buffer.
- Param pMbxTfer:
pMbxTfer
- Param abyData:
abyData
- Param dwDataLen:
dwDataLen
- Return:
Error code
- ECError MbxTferCopyFrom (IntPtr pMbxTfer, byte[] abyData, UInt32 dwDataLen, out UInt32 pdwOutDataLen)
Copies data from the mailbox transfer buffer.
- Param pMbxTfer:
pMbxTfer
- Param abyData:
abyData
- Param dwDataLen:
dwDataLen
- Param pdwOutDataLen:
pdwOutDataLen
- Return:
Error code
- ECError NotifyApp (UInt32 dwCode, byte[] pInData, UInt16 wDataLen, out byte[] pOutData, UInt16 wOutLen, out UInt32 pdwOutDataLen)
Notifies the master application.
- Param dwCode:
Code
- Param pInData:
Input data
- Param wDataLen:
Length of in data
- Param pOutData:
Output data
- Param wOutLen:
Length of output data field
- Param pdwOutDataLen:
Length of actual out data
- Return:
Error code
- ECError InitMotion ()
Initialize the motion.
- Return:
Error code
- ECError DeinitMotion ()
Deinitialize the motion.
- Return:
Error code
- ECError ControlMotion (EC_T_MOTION_CMD dwCmd, byte[] pInData, UInt16 wDataLen, out byte[] pOutData, UInt16 wOutLen)
Controls the motion.
- Param dwCmd:
Command
- Param pObj:
Object
- Param pInData:
Input data
- Param wDataLen:
Length of in data
- Param pOutData:
Output data
- Param wOutLen:
Length of output data field
- Return:
Error code
- void ReadIdentifyObj (ushort wFixedAddr)
Reads the identify object of a slave.
- Param wFixedAddr:
Fixed station address
- void AddDbgMsg (string strDbgMsg)
Adds a debug message to the print message queue.
- Param strDbgMsg:
debug message
- ECError GetSlaveInfoEx (DN_EC_T_SB_SLAVEINFO_REQ_DESC oReq, out DN_EC_T_SB_SLAVEINFO_RES_DESC oRes)
Gets the extended slave info determined in the last bus scan.
- Param oReq:
Request parameter
- Param oRes:
The extended slave information structure
- Return:
Error code
- ECError GetMasterParms (out DN_EC_T_INIT_MASTER_PARMS pParms)
Get current Master initialization parameters.
If the given buffer is larger than the actual size of 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.
- Param pParms:
Buffer to store Master parameters
- Return:
EC_E_NOERROR on success
EC_E_INVALIDSTATE if master isn’t initialized
EC_E_INVALIDPARM if buffer pParms is too small
- ECError SetMasterParms (DN_EC_T_INIT_MASTER_PARMS pParms)
Change Master initialization parameters.
Currently the following parameters cannot be changed:
EC_T_INIT_MASTER_PARMS.pOsParms
EC_T_INIT_MASTER_PARMS.pLinkParms
EC_T_INIT_MASTER_PARMS.pLinkParmsRed
EC_T_INIT_MASTER_PARMS.dwMaxBusSlaves
EC_T_INIT_MASTER_PARMS.dwMaxAcycFramesQueued
EC_T_INIT_MASTER_PARMS.dwAdditionalEoEEndpoints
- Param pParms:
New Master parameters
- Return:
EC_E_NOERROR on success
EC_E_INVALIDSTATE if master isn’t initialized
- ECError ForceSlvStatCollection ()
Sends datagrams to collect slave statistics counters.
- Return:
Error code
- ECError GetSlvStatistics (UInt32 dwSlaveId, out DN_EC_T_SLVSTATISTICS_DESC oStatistics)
Returns slave statistics counters.
- Param dwSlaveId:
Slave ID
- Param oStatistics:
out Statistics counters
- Return:
Error code
- ECError GetCyclicConfigInfo (out DN_EC_T_CYC_CONFIG_DESC[] oCyclicConfigInfo)
Returns an array of cyclic tasks.
- Param oCyclicConfigInfo:
out Array of cyclic tasks
- Return:
Error code
- ECError SetAllSlavesMustReachState (bool bAllSlavesMustReachState)
Sets flag that all slaves must reach the requested master state.
- Param bAllSlavesMustReachState:
EC_TRUE: All slaves must reach the requested master state
- Return:
Error code
- ECError SetAdditionalVariablesForSpecificDataTypesEnabled (bool bAdditionalVariablesForSpecificDataTypes)
Sets flag to enable additional variables for specific data types.
- Param bAdditionalVariablesForSpecificDataTypes:
EC_TRUE: Enable additional variables for specific data types
- Return:
Error code
- ECError EnableNotification (UInt32 dwClientId, DN_NotifyCode tNotifyCode, bool bEnable)
Enables notification.
- Param dwClientId:
Client Id
- Param tNotifyCode:
Code of notification, which should be enabled
- Param bEnable:
EC_TRUE: Enables notification
- Return:
Error code
- ECError ThrottleNotification (DN_NotifyCode tNotifyCode, uint dwTimeout)
Throttles notification.
- Param tNotifyCode:
Code of notification, which should be throttled
- Param dwTimeout:
0 = Not throttled, > 0 = Throttle timeout in ms
- Return:
Error code
- ECError SdoUploadMasterOd (UInt16 wObIndex, UInt32 dwTimeout, out object pobjMasterOd)
SdoUpload from Master Object Dictionary.
- Param wObIndex:
Object index
- Param dwTimeout:
Timeout in milliseconds
- Param pobjMasterOd:
Read object (e.g. DN_EC_T_OBJ3XXX, EC_T_OBJ8XXX, EC_T_OBJ9XXX …)
- Return:
Error code
- ECError ReadSlaveEEPRom (bool bFixedAddressing, UInt16 wSlaveAddress, UInt16 wEEPRomStartOffset, byte[] pwReadData, UInt32 dwReadLen, out UInt32 pdwNumOutData, UInt32 dwTimeout)
Read EEPRom data from slave.
- Param bFixedAddressing:
EC_TRUE: use station addressing, EC_FALSE: use auto increment addressing
- Param wSlaveAddress:
Slave Address, station or auto increment address depending on bFixedAddressing
- Param wEEPRomStartOffset:
Address to start EEPRom Read from
- Param pwReadData:
Pointer to ushort array to carry the read data
- Param dwReadLen:
Size of the ushort array provided at pwReadData (in ushorts)
- Param pdwNumOutData:
out Pointer to uint carrying actually read data (in ushorts) after completion
- Param dwTimeout:
Timeout in milliseconds. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT
- Return:
Error code
- ECError ReadSlaveEEPRomWithReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, UInt16 wSlaveAddress, UInt16 wEEPRomStartOffset, byte[] pwReadData, UInt32 dwReadLen, out UInt32 pdwNumOutData, UInt32 dwTimeout)
Read EEPRom data from slave (REQ)
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_EEPROM_OPERATION_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station addressing, EC_FALSE: use auto increment addressing
- Param wSlaveAddress:
Slave Address, station or auto increment address depending on bFixedAddressing
- Param wEEPRomStartOffset:
Address to start EEPRom Read from
- Param pwReadData:
Pointer to ushort array to carry the read data
- Param dwReadLen:
Size of the ushort array provided at pwReadData (in ushorts)
- Param pdwNumOutData:
out Pointer to uint carrying actually read data (in ushorts) after completion
- Param dwTimeout:
Timeout in milliseconds. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT
- Return:
Error code
- ECError WriteSlaveEEPRom (bool bFixedAddressing, UInt16 wSlaveAddress, UInt16 wEEPRomStartOffset, byte[] pwWriteData, UInt32 dwWriteLen, UInt32 dwTimeout)
Write EEPRom data from slave.
- Param bFixedAddressing:
EC_TRUE: use station addressing, EC_FALSE: use auto increment addressing
- Param wSlaveAddress:
Slave Address, station or auto increment address depending on bFixedAddressing
- Param wEEPRomStartOffset:
Address to start EEPRom Write from
- Param pwWriteData:
Pointer to WORD array carrying the write data.
- Param dwWriteLen:
Sizeof Write Data WORD array (in WORDS)
- Param dwTimeout:
Timeout in milliseconds. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT
- Return:
Error code
- ECError WriteSlaveEEPRomWithReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, UInt16 wSlaveAddress, UInt16 wEEPRomStartOffset, byte[] pwWriteData, UInt32 dwWriteLen, UInt32 dwTimeout)
Write EEPRom data from slave (REQ)
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_EEPROM_OPERATION_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station addressing, EC_FALSE: use auto increment addressing
- Param wSlaveAddress:
Slave Address, station or auto increment address depending on bFixedAddressing
- Param wEEPRomStartOffset:
Address to start EEPRom Write from
- Param pwWriteData:
Pointer to WORD array carrying the write data.
- Param dwWriteLen:
Sizeof Write Data WORD array (in WORDS)
- Param dwTimeout:
Timeout in milliseconds. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT
- Return:
Error code
- ECError InitInstance (DN_EC_T_INIT_PARMS oParms)
Initializes EtherCAT wrapper.
- Param oParms:
Parameters
- Return:
Error code
- ECError DeinitInstance ()
Deinitialize EtherCAT wrapper.
- Return:
Error code
- ECError PerfMeasAppCreate (DN_EC_T_PERF_MEAS_APP_PARMS pPerfMeasAppParms, out IntPtr ppvPerfMeas)
Create PerfMeas object and bind it to the master instance.
This API can be called multiple times to create PerfMeas objects. The perfomance counters in each of the objects can be accessed in the following two ways:
by passing the PerfMeas object and the index of the performance measurement. The index ranges from [0-pPerfMeasAppParms->dwNumAppMeas]
by passing EC_NULL instead of a PerfMeas object and an index. In this case the index works across all PerfMeas objects bound to the master instance.
- Param pPerfMeasAppParms:
Pointer to parameter definitions
- Param ppvPerfMeas:
Created PerfMeas object.
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppDelete (IntPtr pvPerfMeas)
Delete application performance measurement and unbind it from the master instance.
Objects which are not deleted using PerfMeasAppDelete are automatically deleted when calling DeinitMaster.
Note
This invalidates the global index used when passing EC_NULL into the other PerfMeasApp functions
- Param pvPerfMeas:
PerfMeas object to delete
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppStart (IntPtr pvPerfMeas, uint dwIndex)
Start application performance measurement.
- Param pvPerfMeas:
PerfMeas object or EC_NULL to use continuous index
- Param dwIndex:
Index of the performance measurement
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppEnd (IntPtr pvPerfMeas, uint dwIndex)
Stop application performance measurement.
- Param pvPerfMeas:
PerfMeas object or EC_NULL to use continuous index
- Param dwIndex:
Index of the performance measurement
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppReset (IntPtr pvPerfMeas, uint dwIndex)
Reset application performance measurement.
- Param pvPerfMeas:
PerfMeas object or EC_NULL to use continuous index
- Param dwIndex:
Index of the performance measurement, use 0xFFFFFFFF to reset all
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppGetRaw (IntPtr pvPerfMeas, uint dwIndex, DN_EC_T_PERF_MEAS_VAL[] pPerfMeasVal, DN_EC_T_PERF_MEAS_HISTOGRAM[] pPerfMeasHistogram, uint dwPerfMeasNumOf)
Get raw data of one/all application performance measurement.
- Param pvPerfMeas:
PerfMeas object or EC_NULL to use continuous index
- Param dwIndex:
Index of the performance measurement, use 0xFFFFFFFF to get all
- Param pPerfMeasVal:
Pointer to a buffer receiving one/all performance measurement values or EC_NULL
- Param pPerfMeasHistogram:
Pointer to a buffer receiving one/all performance measurement histograms or EC_NULL
- Param dwPerfMeasNumOf:
Number of elements allocated in pPerfMeasVal and pPerfMeasHistogram
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppGetInfo (IntPtr pvPerfMeas, uint dwIndex, out DN_EC_T_PERF_MEAS_INFO[] pPerfMeasInfo, uint dwPerfMeasNumOf)
Get general info about one/all application performance measurement.
- Param pvPerfMeas:
PerfMeas object or EC_NULL to use continous index
- Param dwIndex:
Index of the performance measurement information, use 0xFFFFFFFF to get all
- Param pPerfMeasInfo:
Pointer to a buffer receiving one/all performance measurement information
- Param dwPerfMeasNumOf:
Number of elements allocated in pPerfMeasInfo
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasAppGetNumOf (IntPtr pvPerfMeas, out uint pdwNumOf)
Reset number of application performance measurement.
- Param pvPerfMeas:
PerfMeas object or EC_NULL to get the number of performance measurements in all PerfMeas objects
- Param pdwNumOf:
Number of performance measurements
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasResetByTaskId (uint dwTaskId, uint dwIndex)
Reset internal performance measurement.
- Param dwTaskId:
Task Job ID
- Param dwIndex:
Index of the performance measurement, use 0xFFFFFFFF to reset all
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasGetRawByTaskId (uint dwTaskId, uint dwIndex, DN_EC_T_PERF_MEAS_VAL[] pPerfMeasVal, DN_EC_T_PERF_MEAS_HISTOGRAM[] pPerfMeasHistogram, uint dwPerfMeasNumOf)
Get raw data of one/all application performance measurement.
- Param dwTaskId:
Task Job ID
- Param dwIndex:
Index of the performance measurement, use 0xFFFFFFFF to get all
- Param pPerfMeasVal:
Pointer to a buffer receiving one/all performance measurement values or EC_NULL
- Param pPerfMeasHistogram:
Pointer to a buffer receiving one/all performance measurement histograms or EC_NULL
- Param dwPerfMeasNumOf:
Number of elements allocated in pPerfMeasVal and pPerfMeasHistogram
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasGetInfoByTaskId (uint dwTaskId, uint dwIndex, out DN_EC_T_PERF_MEAS_INFO[] pPerfMeasInfo, uint dwPerfMeasNumOf)
Get general info about one/all internal performance measurement.
- Param dwTaskId:
Task Job ID
- Param dwIndex:
Index of the performance measurement, use 0xFFFFFFFF to get all
- Param pPerfMeasInfo:
Pointer to a buffer receiving one/all performance measurement infos
- Param dwPerfMeasNumOf:
Number of elements allocated in pPerfMeasInfo
- Return:
EC_E_NOERROR or an error code
- ECError PerfMeasGetNumOfByTaskId (uint dwTaskId, out uint pdwNumOf)
Reset number of internal performance measurement.
- Param dwTaskId:
Task Job ID
- Param pdwNumOf:
Number of performance measurements
- Return:
EC_E_NOERROR or an error code
- ECError SetLogParms (DN_EC_T_LOG_PARMS pLogParms)
Sets log parameters. Used to change the parameters provided by emInitMaster().
EC_MONITOR Sets log parameters. Used to change the parameters provided by emonInitMonitor().
EC_SIMULATOR Sets log parameters. Used to change the parameters provided by esInitSimulator().
- Param pLogParms:
New Log parameters
- Return:
- ECError SetMasterRedStateReq (bool bActive)
Requests Master Redundancy State ACTIVE / INACTIVE.
- Param bActive:
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized or MasterRedParms.bEnabled = EC_FALSE
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTSUPPORTED if EC-Master stack does not include Master Redundancy support
- ECError GetMasterRedState (out bool pbActive)
Gets Master Redundancy State (ACTIVE / INACTIVE).
- Param pbActive:
Pointer to variable of type EC_T_BOOL
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized or MasterRedParms.bEnabled = EC_FALSE
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTSUPPORTED if EC-Master stack does not include Master Redundancy support
- byte[] GetMasterRedProcessImageInputPtr ()
Gets the Master Redundancy process data input image pointer.
- Return:
Master Redundancy process data input image pointer
- byte[] GetMasterRedProcessImageOutputPtr ()
Gets the Master Redundancy process data output image pointer.
- Return:
Master Redundancy process data output image pointer
- ECError IoCtl (uint dwCode, byte[] pbyInBuf, uint dwInBufSize, byte[] pbyOutBuf, uint dwOutBufSize, out uint pdwNumOutData)
A generic control interface between the application, the EtherCAT stack and its Link Layers.
- Param dwCode:
IOCTL code (EC_IOCTL…)
- Param pbyInBuf:
IOCTL input parameters
- Param dwInBufSize:
Size of IOCTL input parameters in bytes
- Param pbyOutBuf:
Buffer for IOCTL output
- Param dwOutBufSize:
Size of buffer at pbyOutBuf in bytes
- Param pdwNumOutData:
Amount of bytes written to pbyOutBuf by IOCTL. EC_NULL: amount not set by IOCTL.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer
EC_E_NOMEMORY if memory cannot be allocated
EC_E_ADS_IS_RUNNING if the ADS server is running
- ECError ScanBus (uint 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.
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_LINK_DISCONNECTED if link is disconnected
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_BUSCONFIG_MISMATCH if the slaves found do not match the configured ones
EC_E_LINE_CROSSED if a line crossed (cabling wrong) condition has been detected
EC_E_REDLINEBREAK if cable redundancy is configured and a line break condition has been detected
EC_E_JUNCTION_RED_LINE_BREAK if junction redundancy is configured and a line break condition has been detected
EC_E_MAX_BUS_SLAVES_EXCEEDED if the amount of slaves found exceeds EC_T_INIT_MASTER_PARMS.dwMaxBusSlaves
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if the ADS server is running
- ECError RescueScan (uint 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.
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError GetMasterInfo (out DN_EC_T_MASTER_INFO pMasterInfo)
Get generic information about the Master.
- Param pMasterInfo:
Master information
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or pParms is NULL or contains values out of range
EC_E_ADS_IS_RUNNING if ADS server is running
- ECError ConfigureNetwork (DN_EC_T_CNF_TYPE eCnfType, byte[] pbyCnfData, uint 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.
A client must not be registered prior to calling this function. Existing client registrations will be dropped.
- Param eCnfType:
Type of configuration data provided
- Param pbyCnfData:
Filename / configuration data, or EC_NULL if eCnfType is
- Param dwCnfDataLen:
Length of configuration data in byte, or zero if eCnfType is
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized or eCnfType is eCnfType_GenPreopENI or eCnfType_GenOpENI and link is disconnected
EC_E_INVALIDPARM if dwInstanceID is out of range or pParms is EC_NULL contains some values out of range
EC_E_LINK_DISCONNECTED if link is disconnected
EC_E_FEATURE_DISABLED if a configured feature is not included in the license key
EC_E_NOTSUPPORTED if a configured feature is not supported (e.g not compiled in the library)
EC_E_CFGFILENOTFOUND if the ENI file cannot be found
EC_E_WRONG_FORMAT if format errors have been detected in the ENI or EEPROM in case of eCnfType_GenPreopENI or eCnfType_GenOpENI
EC_E_OEM_SIGNATURE_MISMATCH if the OEM signature in the ENI file doesn’t match the used OEM key
EC_E_ENI_ENCRYPTION_WRONG_VERSION if the ENI encryption version is not supported (e.g. the library is too old)
EC_E_ENI_ENCRYPTED if the ENI is encrypted and no OEM key has been set
EC_E_XML_CYCCMDS_MISSING if the ENI doesn’t contain cyclic commands
EC_E_XML_ALSTATUS_READ_MISSING if the ENI doesn’t contain any read AL status command
EC_E_XML_CYCCMDS_SIZEMISMATCH if the size of the cyclic commands in the ENI mismatch
EC_E_XML_INVALID_INP_OFF if some input offsets in the ENI are invalid
EC_E_XML_INVALID_OUT_OFF if some output offsets in the ENI are invalid
EC_E_XML_INVALID_CMD_WITH_RED if the ENI contains LRW commands and cable redundancy is configured
EC_E_XML_PREV_PORT_MISSING if some previous port information are missing in the ENI
EC_E_XML_DC_CYCCMDS_MISSING if the DC related cyclic commands are missing in the ENI
EC_E_XML_AOE_NETID_INVALID if the ENI contains some invalid NetID
- ECError ConfigLoad (DN_EC_T_CNF_TYPE eCnfType, byte[] pbyCnfData, uint dwCnfDataLen)
Load the network configuration.
In combination with emConfigApply, this function replaces emConfigureNetwork and must be called after the initialization. Among others the EtherCAT topology defined in the given XML configuration file will be stored internally.
A client must not be registered prior to calling this function. Existing client registrations will be dropped.
- Param eCnfType:
Type of configuration data provided
- Param pbyCnfData:
Configuration data
- Param dwCnfDataLen:
Length of configuration data in byte
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer
EC_E_NOMEMORY if some memory cannot be allocated
EC_E_ADS_IS_RUNNING if the ADS server is running
- ECError ConfigExcludeSlave (ushort wStationAddress)
Exclude a slave from the network configuration.
It has to be called after emConfigLoad and prior to calling emConfigApply.
- Param wStationAddress:
Station address of the slave to be excluded. A value of 0 excludes all slaves.
- Return:
EC_E_NOERROR or error code
- ECError ConfigIncludeSlave (ushort wStationAddress)
Include a slave in the network configuration.
Slaves that were previously excluded with emConfigSlaveExclude can be added again. It has to be called after emConfigLoad and prior to calling emConfigApply.
- Param wStationAddress:
Station address of the slave to be included. A value of 0 includes all slaves.
- Return:
EC_E_NOERROR or error code
- ECError ConfigSetPreviousPort (ushort wStationAddress, ushort wStationAddressPrev, ushort wPortPrev)
Set previous port information of a slave.
It has to be called after emConfigLoad and prior to calling emConfigApply.
- Param wStationAddress:
Station address of the slave
- Param wStationAddressPrev:
Previous slave station address
- Param wPortPrev:
Previous port
- Return:
EC_E_NOERROR or error code
- ECError ConfigAddJunctionRedundancyConnection (ushort wHeadStationAddress, ushort wHeadRedPort, ushort wTailStationAddress, ushort wTailRedPort)
Add a junction redundancy connection.
Since there is no mechanism to configure junction redundancy in the ENI, this API allows adding junction redundancy connections which will be validated by the EC-Master stack. It has to be called after emConfigLoad and prior to calling emConfigApply. Calling this API enables junction redundancy support implicitly.
- Param wHeadStationAddress:
Station address of the junction redundancy head slave. Typically this is an EtherCAT junction.
- Param wHeadRedPort:
Port at head slave to which the junction redundancy cable is connected. Must be ESC_PORT_B.
- Param wTailStationAddress:
Station address of the junction redundancy tail slave
- Param wTailRedPort:
Port at tail slave to which the junction redundancy cable is connected. May not be ESC_PORT_A.
- Return:
EC_E_NOERROR or error code
- ECError ConfigAddCableRedundancyConnection (ushort wStationAddress, ushort wRedPort)
Add a cable redundancy connection.
This API defines where the redundancy cable is plugged in, in which slave and at which port. It has to be called after emConfigLoad and prior to calling emConfigApply.
- Param wStationAddress:
Station address of the cable redundancy slave
- Param wRedPort:
Slave port to which the junction redundancy cable is connected.
- Return:
EC_E_NOERROR or error code
- ECError ConfigApply ()
Apply the network configuration.
It has to be called after emConfigLoad.
- Return:
EC_E_NOERROR or error code
- ECError ConfigExtend (bool bResetConfig, uint 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.
This function may not be called from within the JobTask’s context.
- Param bResetConfig:
EC_TRUE: Extended configuration will be removed
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError IsConfigured (out bool pbIsConfigured)
Returns if configuration has been applied.
- Param pbIsConfigured:
EC_TRUE if configuration has been applied
- Return:
EC_E_NOERROR or error code
- ECError SetMasterState (uint dwTimeout, DN_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.
- Param dwTimeout:
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.
- Param eReqState:
Requested System state
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if the ADS server is running
- ECError SetMasterStateReq (uint dwTimeout, DN_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.
- Param dwTimeout:
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.
- Param eReqState:
Requested System state
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
- DN_EC_T_STATE GetMasterState ()
Get the EtherCAT master current state.
- Return:
EtherCAT master state
- ECError GetMasterStateEx (out ushort pwCurrState, out ushort pwReqState)
Get the EtherCAT master current and requested state. Possible return values for current and requested state:
#DEVICE_STATE_UNKNOWN
#DEVICE_STATE_INIT
#DEVICE_STATE_PREOP
#DEVICE_STATE_SAFEOP
#DEVICE_STATE_OP
- Param pwCurrState:
Current master state
- Param pwReqState:
Requested master state
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointers are EC_NULL
- uint GetSlaveId (ushort wStationAddress)
Determines the slave ID using the slave station address.
- Param wStationAddress:
Station address of the slave
- Return:
Slave ID or INVALID_SLAVE_ID if the slave could not be found or the stack is not initialized
- ECError GetSlaveFixedAddr (uint dwSlaveId, out ushort pwFixedAddr)
Determine slave station address according to its slave ID.
- Param dwSlaveId:
Slave ID
- Param pwFixedAddr:
Corresponding fixed address
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointer is EC_NULL
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
- uint GetSlaveIdAtPosition (ushort wAutoIncAddress)
Determines the slave ID using the slave auto increment address.
- Param wAutoIncAddress:
Auto increment address of the slave
- Return:
Slave ID or INVALID_SLAVE_ID if no slave matching wAutoIncAddress can be found
- bool GetSlaveProp (uint dwSlaveId, out DN_EC_T_SLAVE_PROP pSlaveProp)
Determines the properties of the slave device.
- Param dwSlaveId:
Slave ID
- Param pSlaveProp:
Slave properties
- Return:
EC_TRUE if the slave exists, EC_FALSE if no slave matching dwSlaveId can be found
- ECError GetSlavePortState (uint dwSlaveId, out ushort pwPortState)
Returns the state of the slave ports.
- Param dwSlaveId:
Slave ID
- Param pwPortState:
Slave port state.Format: wwww xxxx yyyy zzzz (each nibble : port 3210)
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointer is EC_NULL
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
- ECError GetSlaveState (uint dwSlaveId, out ushort pwCurrDevState, out ushort pwReqDevState)
Get the slave state.
The slave state is always read automatically from the AL_STATUS register whenever necessary. It is not forced by calling this function. This function may be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param pwCurrDevState:
Current slave state
- Param pwReqDevState:
Requested slave state
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointers are EC_NULL
EC_E_SLAVE_NOT_PRESENT if the slave is not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
- ECError SetSlaveState (uint dwSlaveId, ushort wDeviceState, uint dwTimeout)
Set a specified slave into the requested EtherCAT state.
The requested state shall not be higher than the overall operational state. DEVICE_STATE_BOOTSTRAP can only be requested if the slave’s state is INIT. This function may not be called from within the JobTask’s context.
If the function is called with EC_NOWAIT, the client may wait for reaching the requested state using the notification callback (EC_NOTIFY_SLAVE_STATECHANGED).
- Param dwSlaveId:
Slave ID
- Param wDeviceState:
Requested device state. See DEVICE_STATES
- Param dwTimeout:
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.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized or denies the requested state, see comments below
EC_E_INVALIDPARM if dwInstanceID is out of range or BOOTSTRAP was requested for a slave that does not support it
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_BUSY if the EtherCAT stack cannot execute the request at this time, the function has to be called at a later time
EC_E_NOTREADY if the working counter was not set when requesting the slave’s state (slave may not be connected or did not respond)
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError SetSlaveStateReq (uint dwSlaveId, ushort wDeviceState, uint dwTimeout)
Request to set a specified slave into the requested EtherCAT state and return immediately.
The requested state shall not be higher than the overall operational state. DEVICE_STATE_BOOTSTRAP can only be requested if the slave’s state is INIT.
- Param dwSlaveId:
Slave ID
- Param wDeviceState:
Requested device state. See DEVICE_STATES
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized or denies the requested state, see comments below
EC_E_INVALIDPARM if dwInstanceID is out of range or BOOTSTRAP was requested for a slave that does not support it
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_BUSY if the EtherCAT stack cannot execute the request at this time, the function has to be called at a later time
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError GetProcessVarInfoNumOf (DN_EC_T_VAR_DIRECTION eVarDirection, DN_EC_T_VAR_SOURCE eVarSource, bool bFixedAddress, ushort wSlaveAddress, out uint pdwProcessVarInfoNumOf)
Get process variables information.
- Param eVarDirection:
INPUTs, OUTPUTs, … . See EC_T_VAR_DIRECTION .
- Param eVarSource:
Slave, Master, … . See EC_T_VAR_SOURCE .
- Param bFixedAddress:
Use station address if EC_TRUE. Otherwise use AutoInc address.
- Param wSlaveAddress:
Slave address according to bFixedAddress
- Param pdwProcessVarInfoNumOf:
Process variables count
- Return:
EC_E_NOERROR or error code
- ECError GetProcessVarInfoEx (DN_EC_T_VAR_DIRECTION eVarDirection, DN_EC_T_VAR_SOURCE eVarSource, bool bFixedAddress, ushort wSlaveAddress, out DN_EC_T_PROCESS_VAR_INFO_EX[] aoVarInfo, uint dwMaxProcessVarInfoNumOf, out uint pdwProcessVarInfoNumOf)
Get process variables information.
- Param eVarDirection:
INPUTs, OUTPUTs, … . See EC_T_VAR_DIRECTION .
- Param eVarSource:
Slave, Master, … . See EC_T_VAR_SOURCE .
- Param bFixedAddress:
Use station address if EC_TRUE. Otherwise use AutoInc address.
- Param wSlaveAddress:
Slave address according to bFixedAddress
- Param aoVarInfo:
The read process variable extended information entries
- Param dwMaxProcessVarInfoNumOf:
- Param pdwProcessVarInfoNumOf:
- Return:
EC_E_NOERROR or error code
- ECError TferSingleRawCmd (DN_EC_T_CMD eCmd, uint dwMemoryAddress, byte[] pbyData, ushort wLen, uint dwTimeout)
Transfers a single raw EtherCAT command to one or multiple slaves and waits for the result.
Using this function it is possible to exchange arbitrary data between the master and the slaves. When the master receives the response to the queued frame it raises EC_NOTIFY_RAWCMD_DONE to all clients. This function blocks until the command is completely processed. In case of read commands the slave data will be written back into the given memory area. If a timeout occurs (e.g. due to a bad line quality) the corresponding frame will be sent again. The timeout value and retry counter can be set using the master configuration parameters dwEcatCmdTimeout and dwEcatCmdMaxRetries. The call will return in any case (without waiting for the number of retries specified in dwEcatCmdMaxRetries) if the time determined with the dwTimeout parameter elapsed. Caveat: Using auto increment addressing (APRD, APWR, APRW) may lead to unexpected results in case the selected slave does not increment the working counter. In such cases the EtherCAT command would be handled by the slave directly behind the selected one. This function may not be called from within the JobTask’s context.
- Param eCmd:
EtherCAT command type. See EC_T_CMD
- Param dwMemoryAddress:
Slave memory address, depending on the command to be sent this is either a physical or a logical address
- Param pbyData:
[in, out] Buffer containing or receiving transferred data
- Param wLen:
Number of bytes to transfer
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_BUSY if another transfer request is already pending or the master or the corresponding slave is currently changing its operational state
EC_E_NOTREADY if the working counter was not set when sending the command (slave may not be connected or did not respond)
EC_E_INVALIDSIZE if the size of the complete command does not fit into a single Ethernet frame. The maximum amount of data to transfer must not exceed 1486 bytes.
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError ReadSlaveRegister (bool bFixedAddressing, ushort wSlaveAddress, ushort wRegisterOffset, byte[] pbyData, ushort wLen, uint dwTimeout)
Reads data from the ESC memory that have so far been transferred to a slave and received by the EC-Monitor.
!(EC_MONITOR) Reads data from the ESC memory of a specified slave.
This function may not be called from within the JobTask’s context.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wRegisterOffset:
Register offset. I.e. use 0x0130 to read the AL Status register.
- Param pbyData:
Buffer receiving transfered data
- Param wLen:
Number of bytes to receive
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if the slave is not present
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_BUSY if another transfer request is already pending or the master or the corresponding slave is currently changing its operational state
EC_E_NOTREADY if the working counter was not set when sending the command (slave may not be connected or did not respond)
EC_E_INVALIDSIZE if the size of the complete command does not fit into a single Ethernet frame. The maximum amount of data to transfer must not exceed 1486 bytes.
- ECError ReadSlaveRegisterReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, ushort wSlaveAddress, ushort wRegisterOffset, byte[] pbyData, ushort wLen)
Requests data read transfer from the ESC memory of a specified slave and returns immediately.
A notification EC_NOTIFY_SLAVE_REGISTER_TRANSFER is given on completion. This function may be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_SLAVEREGISTER_TRANSFER_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wRegisterOffset:
Register offset, e.g. use 0x0130 to read the AL Status register
- Param pbyData:
Buffer receiving transfered data
- Param wLen:
Number of bytes to receive
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_INVALIDSIZE if the size of the complete command does not fit into a single Ethernet frame. The maximum amount of data to transfer must not exceed 1486 bytes.
- ECError WriteSlaveRegister (bool bFixedAddressing, ushort wSlaveAddress, ushort wRegisterOffset, byte[] pbyData, ushort wLen, uint dwTimeout)
Writes data into the ESC memory of a specified slave.
This function may not be called from within the JobTask’s context
Changing contents of ESC registers may lead to unpredictable behavior of the slaves and/or the master.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wRegisterOffset:
Register offset. E.g. use 0x0120 to write to the AL Control register.
- Param pbyData:
Buffer containing transfered data
- Param wLen:
Number of bytes to send
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_BUSY if another transfer request is already pending or the master or the corresponding slave is currently changing its operational state
EC_E_NOTREADY if the working counter was not set when sending the command (slave may not be connected or did not respond)
EC_E_INVALIDSIZE if the size of the complete command does not fit into a single Ethernet frame. The maximum amount of data to transfer must not exceed 1486 bytes.
- ECError WriteSlaveRegisterReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, ushort wSlaveAddress, ushort wRegisterOffset, byte[] pbyData, ushort wLen)
Requests a data write transfer into the ESC memory of a specified slave and returns immediately.
A notification EC_NOTIFY_SLAVE_REGISTER_TRANSFER is given on completion. This function may be called from within the JobTask’s context.
Changing contents of ESC registers may lead to unpredictable behavior of the slaves and/or the master.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_SLAVEREGISTER_TRANSFER_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wRegisterOffset:
Register offset. E.g. use 0x0120 to write to the AL Control register.
- Param pbyData:
Buffer containing transferred data
- Param wLen:
Number of bytes to send
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_INVALIDSIZE if the size of the complete command does not fit into a single Ethernet frame. The maximum amount of data to transfer must not exceed 1486 bytes.
- ECError QueueRawCmd (ushort wInvokeId, DN_EC_T_CMD eCmd, uint dwMemoryAddress, byte[] pbyData, ushort wLen)
Transfers a raw EtherCAT command to one or multiple slaves.
All registered clients will be notified. This function may not be called from within the JobTask’s context.
- Param wInvokeId:
Invoke ID to reassign the results to the sent CMD
- Param eCmd:
EtherCAT command
- Param dwMemoryAddress:
Slave memory address, depending on the command to be sent this is either a physical or a logical address
- Param pbyData:
[in, out] Buffer containing or receiving transferred data. In case a read-only command is queued (e.g. APRD) this pointer should be set to a value of EC_NULL.
- Param wLen:
Number of bytes to transfer
- Return:
EC_E_NOERROR or error code
- ECError ClntQueueRawCmd (uint dwClntId, ushort wInvokeId, DN_EC_T_CMD eCmd, uint dwMemoryAddress, byte[] pbyData, ushort wLen)
Transfers a raw EtherCAT command to one or multiple slaves.
Using this function it is possible to exchange data between the master and the slaves. When the response to the queued frame is received, the notification EC_NOTIFY_RAWCMD_DONE is given for the appropriate client. This function queues a single EtherCAT command. Queued raw commands will be sent after sending cyclic process data values. If a timeout occurs the corresponding frame will be sent again, the timeout value and retry counter can be set using the master configuration parameters EC_T_INIT_MASTER_PARMS.dwEcatCmdTimeout and EC_T_INIT_MASTER_PARMS.dwEcatCmdMaxRetries. Using auto increment addressing (APRD, APWR, APRW) may lead to unexpected results in case the selected slave does not increment the working counter. In such cases the EtherCAT command would be handled by the slave directly behind the selected one. This function may not be called from within the JobTask’s context.
- Param dwClntId:
Client ID to be notified (0 if all registered clients shall be notified)
- Param wInvokeId:
Invoke ID to reassign the results to the sent CMD
- Param eCmd:
EtherCAT command
- Param dwMemoryAddress:
Slave memory address, depending on the command to be sent this is either a physical or a logical address
- Param pbyData:
[in, out] Buffer containing or receiving transferred data. In case a read-only command is queued (e.g. APRD) this pointer should be set to a value of EC_NULL.
- Param wLen:
Number of bytes to transfer
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported
EC_E_BUSY if the master or the corresponding slave is currently changing its operational state
EC_E_INVALIDSIZE if the size of the complete command does not fit into a single Ethernet frame. The maximum amount of data to transfer must not exceed 1486 bytes.
- uint GetNumConfiguredSlaves ()
Returns the number of slaves which are configured in the ENI.
- Return:
Number of slaves
- ECError MbxTferAbort (IntPtr pMbxTfer)
Abort a running mailbox transfer.
This function may not be called from within the JobTask’s context.
- Param pMbxTfer:
Mailbox transfer object created with emMbxTferCreate
- Return:
EC_E_NOERROR if successful
- ECError ClntSendRawMbx (uint dwClntId, byte[] pbyMbxCmd, uint dwMbxCmdLen, uint dwTimeout)
Send a raw mailbox command.
- Param dwClntId:
Client ID
- Param pbyMbxCmd:
Buffer containing the raw mailbox command starting with mailbox header
- Param dwMbxCmdLen:
Length of pbyMbxCmd buffer
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError CoeSdoDownloadReq (IntPtr pMbxTfer, uint dwSlaveId, ushort wObIndex, byte byObSubIndex, uint dwTimeout, uint dwFlags)
Initiates a CoE SDO download to an EtherCAT slave device and returns immediately.
The length of the data to be downloaded must be set in EC_T_MBXTFER.dwDataLen. A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param wObIndex:
Object index
- Param byObSubIndex:
Object sub index. If Complete Access only 0 or 1 allowed.
- Param dwTimeout:
Timeout [ms]
- Param dwFlags:
Mailbox Flags. Bit 0: set if Complete Access (EC_MAILBOX_FLAG_SDO_COMPLETE).
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if the slave is not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if the slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if the slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if the ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeSdoDownload (uint dwSlaveId, ushort wObIndex, byte byObSubIndex, byte[] pbyData, uint dwDataLen, uint dwTimeout, uint dwFlags)
Initiates a CoE SDO download to an EtherCAT slave device and returns immediately.
The length of the data to be downloaded must be set in EC_T_MBXTFER.dwDataLen. A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
- Param dwSlaveId:
Slave ID
- Param wObIndex:
Object index
- Param byObSubIndex:
Object sub index. If Complete Access only 0 or 1 allowed.
- Param pbyData:
- Param dwDataLen:
- Param dwTimeout:
Timeout [ms]
- Param dwFlags:
Mailbox Flags. Bit 0: set if Complete Access (EC_MAILBOX_FLAG_SDO_COMPLETE).
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if the slave is not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if the slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if the slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if the ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeSdoUploadReq (IntPtr pMbxTfer, uint dwSlaveId, ushort wObIndex, byte byObSubIndex, uint dwTimeout, uint dwFlags)
Initiates a CoE SDO upload from an EtherCAT slave device to the master and returns immediately.
A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
- Param pMbxTfer:
Mailbox transfer object created with emMbxTferCreate
- Param dwSlaveId:
Slave ID
- Param wObIndex:
Object index
- Param byObSubIndex:
Object sub index. If Complete Access only 0 or 1 allowed.
- Param dwTimeout:
Timeout [ms]
- Param dwFlags:
Mailbox Flags. Bit 0: set if Complete Access (EC_MAILBOX_FLAG_SDO_COMPLETE).
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if the ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeSdoUpload (uint dwSlaveId, ushort wObIndex, byte byObSubIndex, byte[] pbyData, uint dwDataLen, out uint pdwOutDataLen, uint dwTimeout, uint dwFlags)
Initiates a CoE SDO upload from an EtherCAT slave device to the master and returns immediately.
A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
- Param dwSlaveId:
Slave ID
- Param wObIndex:
Object index
- Param byObSubIndex:
Object sub index. If Complete Access only 0 or 1 allowed.
- Param pbyData:
- Param dwDataLen:
- Param pdwOutDataLen:
- Param dwTimeout:
Timeout [ms]
- Param dwFlags:
Mailbox Flags. Bit 0: set if Complete Access (EC_MAILBOX_FLAG_SDO_COMPLETE).
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if the ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeGetODListReq (IntPtr pMbxTfer, uint dwSlaveId, DN_EC_T_COE_ODLIST_TYPE eListType, uint dwTimeout)
Initiates retrieval of a list of object IDs that have so far been transferred to a slave and received by the EC-Monitor and returns immediately.
!(EC_MONITOR) Initiates retrieval of a list of object IDs that are available in a slave and returns immediately.
A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
The mailbox transfer object will receive the slave response containing the list type followed by the list itself. Therefore the buffer must be 2 bytes bigger than the expected list size.
- Param pMbxTfer:
Mailbox transfer
- Param dwSlaveId:
Slave ID
- Param eListType:
Which object types shall be transferred
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeGetObjectDescReq (IntPtr pMbxTfer, uint dwSlaveId, ushort wObIndex, uint dwTimeout)
Initiates retrieval of the description of a specific object and returns immediately.
A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param wObIndex:
Object index
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeGetEntryDescReq (IntPtr pMbxTfer, uint dwSlaveId, ushort wObIndex, byte byObSubIndex, byte byValueInfo, uint dwTimeout)
Initiates retrieval of the description of a specific object entry and returns immediately.
A unique transfer ID must be written into EC_T_MBXTFER.dwTferId. EC_NOTIFY_MBOXRCV is given on completion.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param wObIndex:
Object index
- Param byObSubIndex:
Object sub-index
- Param byValueInfo:
The value info bit mask includes which elements shall be in the response. See EC_COE_ENTRY_VALUEINFO “Value info flags” for available values.
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_COE “CoE SDO error code”
- ECError CoeRxPdoTfer (IntPtr pMbxTfer, uint dwSlaveId, uint dwNumber, uint dwTimeout)
Initiate CoE RxPDO transfer.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param dwNumber:
PDO number
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError CoeProfileGetChannelInfo (bool bStationAddress, ushort wSlaveAddress, uint dwChannel, DN_EC_T_PROFILE_CHANNEL_INFO pInfo)
Return information about a configured CoE profile channel from the ENI file.
- Param bStationAddress:
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param dwChannel:
Channel
- Param pInfo:
Channel info
- Return:
EC_E_NOERROR or error code
- ECError FoeFileUpload (uint dwSlaveId, string achFileName, uint dwFileNameLen, byte[] pbyData, uint dwDataLen, out uint pdwOutDataLen, uint dwPassword, uint dwTimeout)
Execute an FoE File upload from an EtherCAT slave device.
This function is used to upload a complete file. The function returns after the upload has been successfully completed or an error has occurred. This function may not be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param achFileName:
File name of slave file to read
- Param dwFileNameLen:
Length of slave file name in bytes
- Param pbyData:
Buffer receiving transfered data
- Param dwDataLen:
Buffer length [bytes]
- Param pdwOutDataLen:
Length of received data [byte]
- Param dwPassword:
Slave password
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or maximum file name length of 64 bytes (MAX_FILE_NAME_SIZE) exceeded
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_ERROR_CODES_FOE “FoE error code”
- ECError FoeFileDownload (uint dwSlaveId, string achFileName, uint dwFileNameLen, byte[] pbyData, uint dwDataLen, uint dwPassword, uint dwTimeout)
Execute an FoE File download to an EtherCAT slave device.
This function is used to download a complete file. The function returns after the download has been successfully completed or an error has occurred. This function may not be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param achFileName:
File name of slave file to write
- Param dwFileNameLen:
Length of slave file name in bytes
- Param pbyData:
Buffer containing transferred data
- Param dwDataLen:
Buffer length [bytes]
- Param dwPassword:
Slave password
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or maximum file name length of 64 bytes (MAX_FILE_NAME_SIZE) exceeded
EC_E_FOE_ERRCODE_NOTINBOOTSTRAP if slave in BOOTSTRAP and filename not accepted by slave
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_ERROR_CODES_FOE “FoE error code”
- ECError FoeUploadReq (IntPtr pMbxTfer, uint dwSlaveId, string achFileName, uint dwFileNameLen, uint dwPassword, uint dwTimeout)
Initiates an FoE File upload from an EtherCAT slave device.
This function is used to upload a complete file and returns immediately. After the upload has been successfully completed or an error has occurred, EC_NOTIFY_MBOXRCV is raised. The progress of the file transfer is also notified with EC_NOTIFY_MBOXRCV.
EC_NOWAIT as a timeout is still accepted for reasons of compatibility and sets the timeout to 10 seconds
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param achFileName:
File name of slave file to read
- Param dwFileNameLen:
Length of slave file name in bytes
- Param dwPassword:
Slave password
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or maximum file name length of 64 bytes (MAX_FILE_NAME_SIZE) exceeded
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_ERROR_CODES_FOE “FoE error code”
- ECError FoeSegmentedUploadReq (IntPtr pMbxTfer, uint dwSlaveId, string szFileName, uint dwFileNameLen, uint dwFileSize, uint dwPassword, uint dwTimeout)
Initiates or continues a segmented FoE File upload from an EtherCAT slave device.
This function is used to upload a file chunk-by-chunk and returns immediately. An EC_NOTIFY_MBOXRCV is raised to provide the next chunk to the application or to get information about the progress and the change in the transfer status. The slave may have a different mailbox size for BOOTSTRAP than for PREOP, SAFEOP, OP. See EC_T_CFG_SLAVE_INFO.dwMbxInSize2. The maximum chunk size is the slave’s mailbox size - 12 bytes overhead for EtherCAT’s FoE protocol. The mailbox transfer object’s buffer must be at least as big as the chunks to be transferred.
EC_NOWAIT as a timeout is still accepted for reasons of compatibility and sets the timeout to 10 seconds
- Param pMbxTfer:
Pointer to the corresponding mailbox transfer object. EC_T_MBXTFER.pbyMbxTferData: next chunk, EC_T_MBXTFER.dwDataLen: next chunk size.
- Param dwSlaveId:
Slave ID
- Param szFileName:
File name of slave file to write. Only evaluated when initiating the request.
- Param dwFileNameLen:
Length of slave file name in bytes
- Param dwFileSize:
Used only for progress information
- Param dwPassword:
Slave password. Only evaluated when initiating the request.
- Param dwTimeout:
Overall timeout [ms] of the FoE transfer.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or maximum file name length of 64 bytes (MAX_FILE_NAME_SIZE) exceeded
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_ERROR_CODES_FOE “FoE error code”
- ECError FoeDownloadReq (IntPtr pMbxTfer, uint dwSlaveId, string achFileName, uint dwFileNameLen, uint dwPassword, uint dwTimeout)
Initiates an FoE File download to an EtherCAT slave device.
This function is used to download a complete file and returns immediately. After the download has been successfully completed or an error has occurred, EC_NOTIFY_MBOXRCV is raised. The progress of the file transfer is also notified with EC_NOTIFY_MBOXRCV.
EC_NOWAIT as a timeout is still accepted for reasons of compatibility and sets the timeout to 10 seconds
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param achFileName:
File name of slave file to write
- Param dwFileNameLen:
Length of slave file name in bytes
- Param dwPassword:
Slave password
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or maximum file name length of 64 bytes (MAX_FILE_NAME_SIZE) exceeded
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_ERROR_CODES_FOE “FoE error codes”
- ECError FoeSegmentedDownloadReq (IntPtr pMbxTfer, uint dwSlaveId, string szFileName, uint dwFileNameLen, uint dwFileSize, uint dwPassword, uint dwTimeout)
Initiates or continues a segmented FoE File download to an EtherCAT slave device.
This function is used to download a file chunk-by-chunk and returns immediately. An EC_NOTIFY_MBOXRCV is raised to request the next chunk from the application or to provide information about the progress and the change in the transfer status. The slave may have a different mailbox size for BOOTSTRAP than for PREOP, SAFEOP, OP. See EC_T_CFG_SLAVE_INFO.dwMbxInSize2. The maximum chunk size is the slave’s mailbox size - 12 bytes overhead for EtherCAT’s FoE protocol. The mailbox transfer object’s buffer must be at least as big as the chunks to be transferred.
EC_NOWAIT as a timeout is still accepted for reasons of compatibility and sets the timeout to 10 seconds
- Param pMbxTfer:
Pointer to the corresponding mailbox transfer object. EC_T_MBXTFER.pbyMbxTferData: next chunk, EC_T_MBXTFER.dwDataLen: next chunk size.
- Param dwSlaveId:
Slave ID
- Param szFileName:
File name of slave file to write. Only evaluated when initiating the request.
- Param dwFileNameLen:
Length of slave file name in bytes
- Param dwFileSize:
Complete file size (mandatory). Used also for progress information. Only evaluated when initiating the request.
- Param dwPassword:
Slave password. Only evaluated when initiating the request.
- Param dwTimeout:
Overall timeout [ms] of the FoE transfer.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or maximum file name length of 64 bytes (MAX_FILE_NAME_SIZE) exceeded
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_ERROR_CODES_FOE “FoE error code”
- ECError SoeWrite (uint dwSlaveId, byte byDriveNo, byte[] pbyElementFlags, ushort wIDN, byte[] pbyData, uint dwDataLen, uint dwTimeout)
Execute an SoE SSC Write service which downloads data to an EtherCAT slave device.
The function returns after timeout expired or download is completed successfully (Write response is received). It can also perform an SoE SSC Procedure Command. After a procedure command has started, the slave generates a normal SSC Write Response, and the function returns. If the data to be sent with the write service exceeds the mailbox size, the data will be sent fragmented. The fragmented write operation consists of several Write SSC Fragment Services. Therefore the selected Timeout should be increasing with the count of fragments. This function may not be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param byDriveNo:
Drive number to address inside slave device
- Param pbyElementFlags:
[in/out] SoE ElementFlags. Flag indicating elements to address.
- Param wIDN:
IDN of the object to address
- Param pbyData:
Buffer containing transferred data
- Param dwDataLen:
Buffer length [byte]
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_SOE “SoE error code”
- ECError SoeRead (uint dwSlaveId, byte byDriveNo, byte[] pbyElementFlags, ushort wIDN, byte[] pbyData, uint dwDataLen, out uint pdwOutDataLen, uint dwTimeout)
Execute an SoE SCC Read service which uploads data from an EtherCAT SoE slave device.
The received data can consist of several fragments. The reserved data buffer (pbyData) must have space for all received data segments and the selected Timeout should be increasing with the count of fragments.
- Param dwSlaveId:
Slave ID
- Param byDriveNo:
Drive number to address inside slave device
- Param pbyElementFlags:
[in/out] SoE ElementFlags. Flag indicating elements to address.
- Param wIDN:
IDN of the object to address
- Param pbyData:
Buffer receiving transferred data
- Param dwDataLen:
Buffer length [byte]
- Param pdwOutDataLen:
Length of received data [byte]
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_SOE “SoE error code”
- ECError SoeAbortProcCmd (uint dwSlaveId, byte byDriveNo, byte[] pbyElementFlags, ushort wIDN, uint dwTimeout)
Abort SSC Procedure Command sequence.
A Procedure Command takes up some time. After a procedure command has started, the slave generates a normal SSC Write Response. The end of a procedure command is indicated by the Notify SSC Command Execution Service.
This function may not be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param byDriveNo:
Drive number to address inside slave device
- Param pbyElementFlags:
[in/out] SoE ElementFlags. Flag indicating elements to address.
- Param wIDN:
IDN of the object to address
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError SoeWriteReq (IntPtr pMbxTfer, uint dwSlaveId, byte byDriveNo, byte[] pbyElementFlags, ushort wIDN, uint dwTimeout)
Requests an SoE SSC Write and returns immediately.
This function may be called from within the JobTask’s context.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param byDriveNo:
Drive number to address inside slave device
- Param pbyElementFlags:
[in/out] SoE ElementFlags. Flag indicating elements to address.
- Param wIDN:
IDN of the object to address
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_SOE “SoE error code”
- ECError SoeReadReq (IntPtr pMbxTfer, uint dwSlaveId, byte byDriveNo, byte[] pbyElementFlags, ushort wIDN, uint dwTimeout)
Requests an SoE SSC Read and returns immediately.
This function may be called from within the JobTask’s context.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param byDriveNo:
Drive number to address inside slave device
- Param pbyElementFlags:
[in/out] SoE ElementFlags. Flag indicating elements to address.
- Param wIDN:
IDN of the object to address
- Param dwTimeout:
Timeout [ms]. Must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_NOMEMORY if the mailbox protocol queue of the slave is full
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_INVALID_SLAVE_STATE if slave is in an invalid state for mailbox transfer
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
EC_E_ADS_IS_RUNNING if ADS server is running
EC_ERROR_CODES_SOE “SoE error code”
- ECError AoeGetSlaveNetId (uint dwSlaveId, out DN_EC_T_AOE_NETID poAoeNetId)
Retrieve the NetID of a specific EtherCAT device.
- Param dwSlaveId:
Slave ID
- Param poAoeNetId:
AoE NetID of the corresponding slave
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer, or dwTimeout is EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave has no mailbox support
EC_E_ADS_IS_RUNNING if ADS server is running
- ECError AoeRead (uint dwSlaveId, DN_EC_T_AOE_NETID poTargetNetId, ushort wTargetPort, uint dwIndexGroup, uint dwIndexOffset, uint dwDataLen, byte[] pbyData, out uint pdwDataOutLen, out uint pdwErrorCode, out uint pdwCmdResult, uint dwTimeout)
Execute an AoE mailbox read request to an EtherCAT slave device.
This function may not be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param poTargetNetId:
Target NetID
- Param wTargetPort:
Target port
- Param dwIndexGroup:
AoE read command index group
- Param dwIndexOffset:
AoE read command index offset
- Param dwDataLen:
Buffer length [bytes]
- Param pbyData:
Buffer receiving transferred data
- Param pdwDataOutLen:
Number of bytes read from the target device
- Param pdwErrorCode:
AoE response error code
- Param pdwCmdResult:
AoE read command result code
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR on success
EC_E_AOE_VENDOR_SPECIFIC if the AoE device has responded with a user defined error code
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError AoeReadReq (IntPtr pMbxTfer, uint dwSlaveId, DN_EC_T_AOE_NETID poTargetNetId, ushort wTargetPort, uint dwIndexGroup, uint dwIndexOffset, uint dwTimeout)
Execute a non-blocking AoE mailbox read request to an EtherCAT slave device.
If the functions returns EC_E_AOE_DEVICE_XXXX (well known device errors) or EC_E_AOE_VENDOR_SPECIFIC the original ADS error can be retrieved from the mailbox transfer object at EC_T_MBXTFER.MbxData.AoE_Response. A unique transfer ID must be written into EC_T_MBXTFER.dwTferId.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param poTargetNetId:
Target NetID
- Param wTargetPort:
Target port
- Param dwIndexGroup:
AoE read command index group
- Param dwIndexOffset:
AoE read command index offset
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR on success
EC_E_AOE_VENDOR_SPECIFIC if the AoE device has responded with a user defined error code
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError AoeWrite (uint dwSlaveId, DN_EC_T_AOE_NETID poTargetNetId, ushort wTargetPort, uint dwIndexGroup, uint dwIndexOffset, uint dwDataLen, byte[] pbyData, out uint pdwErrorCode, out uint pdwCmdResult, uint dwTimeout)
Execute an AoE mailbox write request to an EtherCAT slave device.
This function may not be called from within the JobTask’s context.
- Param dwSlaveId:
Slave ID
- Param poTargetNetId:
Target NetID
- Param wTargetPort:
Target port
- Param dwIndexGroup:
AoE write command index group
- Param dwIndexOffset:
AoE write command index offset
- Param dwDataLen:
Buffer length [bytes]
- Param pbyData:
Buffer containing transfered data
- Param pdwErrorCode:
Pointer to AoE response error code
- Param pdwCmdResult:
Pointer to AoE write command result code
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR on success
EC_E_AOE_VENDOR_SPECIFIC if the AoE device has responded with a user defined error code
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError AoeWriteReq (IntPtr pMbxTfer, uint dwSlaveId, DN_EC_T_AOE_NETID poTargetNetId, ushort wTargetPort, uint dwIndexGroup, uint dwIndexOffset, uint dwTimeout)
Execute a non-blocking AoE mailbox write request to an EtherCAT slave device.
If the function returns EC_E_AOE_DEVICE_XXXX (well known device errors) or EC_E_AOE_VENDOR_SPECIFIC the original ADS error can be retrieved from the mailbox transfer object at EC_T_MBXTFER.MbxData.AoE_Response. A unique transfer ID must be written into EC_T_MBXTFER.dwTferId.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param poTargetNetId:
Target NetID
- Param wTargetPort:
Target port
- Param dwIndexGroup:
AoE write command index group
- Param dwIndexOffset:
AoE write command index offset
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR on success
EC_E_AOE_VENDOR_SPECIFIC if the AoE device has responded with a user defined error code
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError AoeReadWrite (uint dwSlaveId, DN_EC_T_AOE_NETID poTargetNetId, ushort wTargetPort, uint dwIndexGroup, uint dwIndexOffset, uint dwReadDataLen, uint dwWriteDataLen, byte[] pbyData, out uint pdwDataOutLen, out uint pdwErrorCode, out uint pdwCmdResult, uint dwTimeout)
Execute an AoE mailbox read/write request to an EtherCAT slave device.
- Param dwSlaveId:
Slave ID
- Param poTargetNetId:
Target NetID
- Param wTargetPort:
Target port
- Param dwIndexGroup:
AoE read/write command index group
- Param dwIndexOffset:
AoE read/write command index offset
- Param dwReadDataLen:
Number of bytes to read from the target device
- Param dwWriteDataLen:
Number of bytes to write to the target device
- Param pbyData:
[in, out] Buffer containing and receiving transfered data
- Param pdwDataOutLen:
Number of bytes read from the target device
- Param pdwErrorCode:
Pointer to AoE response error code
- Param pdwCmdResult:
Pointer to AoE write command result code
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. EC_NOWAIT is not valid.
- Return:
EC_E_NOERROR on success
EC_E_AOE_VENDOR_SPECIFIC if the AoE device has responded with a user defined error code
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError AoeWriteControl (uint dwSlaveId, DN_EC_T_AOE_NETID poTargetNetId, ushort wTargetPort, ushort wAoEState, ushort wDeviceState, uint dwDataLen, byte[] pbyData, out uint pdwErrorCode, out uint pdwCmdResult, uint dwTimeout)
Execute an AoE mailbox write control request to an EtherCAT slave device.
- Param dwSlaveId:
Slave ID
- Param poTargetNetId:
Target NetID. The Target NetID of a AoE slave device can be retrieved by ecatAoeGetSlaveNetId().
- Param wTargetPort:
Target port
- Param wAoEState:
AoE state
- Param wDeviceState:
Device specific state
- Param dwDataLen:
Buffer length [bytes]
- Param pbyData:
Buffer containing transfered data
- Param pdwErrorCode:
Pointer to AoE response error code
- Param pdwCmdResult:
Pointer to AoE write command result code
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. EC_NOWAIT is not valid.
- Return:
EC_E_NOERROR on success
EC_E_AOE_VENDOR_SPECIFIC if the AoE device has responded with a user defined error code
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError VoeRead (uint dwSlaveId, byte[] pbyData, uint dwDataLen, out uint pdwOutDataLen, uint dwTimeout)
Retrieves VoE mailbox, that was sent by an EtherCAT slave device.
If a VoE mailbox was already received, further received VoE mailboxes will be discarded as long as this function was not called. The received data includes the Mailbox header of type ETHERCAT_MBOX_HEADER followed by the VoE payload. This function blocks until the VoE data has been successfully received or an error has occurred.
- Param dwSlaveId:
Slave ID
- Param pbyData:
Buffer receiving transferred data
- Param dwDataLen:
Buffer length [byte]
- Param pdwOutDataLen:
Length of received data [byte]
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. EC_NOWAIT returns the function immediately.
- Return:
EC_E_NOERROR if the VoE slave has provided some VoE data
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_VOE_NO_MBX_RECEIVED if no VoE data was received
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError VoeWrite (uint dwSlaveId, byte[] pbyData, uint dwDataLen, uint dwTimeout)
Execute a VoE mailbox write to an EtherCAT slave device.
This function blocks until the VoE write has been successfully completed or an error has occurred.
- Param dwSlaveId:
Slave ID
- Param pbyData:
Buffer containing transferred data
- Param dwDataLen:
Buffer length [bytes]. The maximum data length including 6 bytes for the mailbox header is given at EC_T_CFG_SLAVE_INFO.dwMbxOutSize.
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR or error code
- ECError VoeWriteReq (IntPtr pMbxTfer, uint dwSlaveId, uint dwTimeout)
Initiates a VoE mailbox write to an EtherCAT slave device.
The amount of data bytes to write has to be stored in EC_T_MBXTFER.dwDataLen. The maximum data length including 6 bytes for the mailbox header is given at EC_T_CFG_SLAVE_INFO.dwMbxOutSize. A unique transfer ID must be written into EC_T_MBXTFER.dwTferId.
- Param pMbxTfer:
Mailbox transfer object
- Param dwSlaveId:
Slave ID
- Param dwTimeout:
Timeout [ms], EC_NOWAIT returns the function immediately
- Return:
EC_E_NOERROR or error code
- ECError GetProcessData (bool bOutputData, uint dwOffset, byte[] pbyData, uint dwLength, uint dwTimeout)
Blocking function to retrieve consistent process data from outside the JobTask context.
This function requests a copy of the process data (stored in RAM). The actual memcpy operation is executed by the JobTask to ensure data consistency. While waiting for the copy to complete, the calling context blocks and repeatedly calls sleep with an interval of at least the cycle time or one millisecond, whichever is greater. The function returns either with the requested process data once the copy is finished, or when the specified timeout has expired.
The function is blocking and should be used carefully in time-sensitive contexts and may not be called from within the JobTask context.
This function may not be called from within the JobTask’s context.
- Param bOutputData:
EC_TRUE: read output data, EC_FALSE: read input data
- Param dwOffset:
Byte offset in Process data to read from
- Param pbyData:
Buffer receiving transferred data
- Param dwLength:
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError SetProcessData (bool bOutputData, uint dwOffset, byte[] pbyData, uint dwLength, uint dwTimeout)
Write Process data synchronized.
This function may not be called from within the JobTask’s context.
- Param bOutputData:
EC_TRUE: write output data, EC_FALSE: write input data
- Param dwOffset:
Byte offset in Process data to write to
- Param pbyData:
Buffer containing transferred data
- Param dwLength:
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError SetProcessDataBits (bool bOutputData, uint dwBitOffsetPd, byte[] pbyDataSrc, uint dwBitLengthSrc, uint dwTimeout)
Writes a specific number of bits from a given buffer to the process image with a bit offset (synchronized).
This function may not be called from within the JobTask’s context.
- Param bOutputData:
EC_TRUE: write output data, EC_FALSE: write input data
- Param dwBitOffsetPd:
Bit offset in Process data image
- Param pbyDataSrc:
- Param dwBitLengthSrc:
- Param dwTimeout:
Timeout [ms]. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError GetProcessDataBits (bool bOutputData, uint dwBitOffsetPd, byte[] pbyDataDst, uint dwBitLengthDst, uint dwTimeout)
Reads a specific number of bits from the process image to the given buffer with a bit offset (synchronized).
This function may not be called from within the JobTask’s context.
- Param bOutputData:
EC_TRUE: read output data, EC_FALSE: write input data
- Param dwBitOffsetPd:
Bit offset in Process data image
- Param pbyDataDst:
- Param dwBitLengthDst:
- Param dwTimeout:
Timeout [ms]. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError ForceProcessDataBits (uint dwClientId, bool bOutputData, uint dwBitOffsetPd, ushort wBitLength, byte[] pbyData, uint dwTimeout)
Force a specific number of bits from a given buffer to the process image with a bit offset.
All output data set by this API are overwriting the values set by the application. All input data set by this API are overwriting the values read from the slaves. Forcing will be terminated by calling the corresponding functions. This function may not be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param bOutputData:
EC_TRUE: write output data, EC_FALSE: write input data
- Param dwBitOffsetPd:
Bit offset in Process data image
- Param wBitLength:
- Param pbyData:
Buffer containing transfered data
- Param dwTimeout:
Timeout [ms]. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError ReleaseProcessDataBits (uint dwClientId, bool bOutputData, uint dwBitOffsetPd, ushort wBitLength, uint dwTimeout)
Release previously forced process data.
Forced output: Value set by application become valid again. Because forced process data bits are written directly into the process output image, the application has to update the process image with the required value, otherwise the forced value is still valid.
Forced input: Value read from the slaves become valid again.
This function may not be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param bOutputData:
EC_TRUE: write output data, EC_FALSE: write input data
- Param dwBitOffsetPd:
Bit offset in Process data image
- Param wBitLength:
Number of bits that shall be written to the process image.
- Param dwTimeout:
Timeout [ms]. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError ReleaseAllProcessDataBits (uint dwClientId, uint dwTimeout)
Release all previously forced process data for a dedicated client.
Forced output: Value set by application become valid again. Because forced process data bits are written directly into the process output image, the application has to update the process image with the required value, otherwise the forced value is still valid.
Forced input: Value read from the slaves become valid again.
This function may not be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTimeout:
Timeout [ms]. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- uint GetNumConnectedSlaves ()
Get number of currently connected slaves.
- Return:
Number of connected slaves
- uint GetNumConnectedSlavesMain ()
Get the number of currently connected Slaves to main interface.
- Return:
Number of connected slaves at main interface
- uint GetNumConnectedSlavesRed ()
Get the number of currently connected Slaves to redundancy interface.
- Return:
Number of connected slaves at redundancy interface
- ECError ReloadSlaveEEPRom (bool bFixedAddressing, ushort wSlaveAddress, uint dwTimeout)
Causes a slave to reload its EEPROM values to ESC registers.
Alias address at 0x12 is not reloaded through this command, this is prevented by the slave hardware. The slave controller must be reset to reload the alias address. This function may not be called from within the JobTask’s context.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError ReloadSlaveEEPRomReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, ushort wSlaveAddress, uint dwTimeout)
Request a slave to reload its EEPROM values to ESC registers, and returns immediately.
Alias address at 0x12 is not reloaded through this command, this is prevented by the slave hardware. The slave controller must be reset to reload the alias address. An EC_NOTIFY_EEPROM_OPERATION is given on completion or timeout. This function may be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_EEPROM_OPERATION_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError ResetSlaveController (bool bFixedAddressing, ushort wSlaveAddress, uint dwTimeout)
Reset EtherCAT slave controller (ESC)
A special sequence of three independent and consecutive frames/commands is sent to the slave (reset register ECAT 0x0040 or PDI 0x0041), after which the slave resets. If that fails, the reset sequence is repeated until it succeeds or the timeout expires. The ESC must support resetting and the slave state should be INIT when calling this function. The number of acyclic frames per cycle EC_T_INIT_MASTER_PARMS.dwMaxAcycFramesPerCycle must be at least 3, otherwise an error is returned. This function may not be called from within the JobTask’s context.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
EC_E_NOTSUPPORTED if EC_T_INIT_MASTER_PARMS.dwMaxAcycFramesPerCycle is less than 3
EC_E_SLAVE_NOT_PRESENT if the slave is not present
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError AssignSlaveEEPRom (bool bFixedAddressing, ushort wSlaveAddress, bool bSlavePDIAccessEnable, bool bForceAssign, uint dwTimeout)
Set EEPROM Assignment to PDI or EtherCAT Master.
This function may not be called from within the JobTask’s context.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param bSlavePDIAccessEnable:
EC_TRUE: EEPROM assigned to slave PDI application,
- Param bForceAssign:
Force Assignment of EEPROM (only for ECat Master Assignment)
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError AssignSlaveEEPRomReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, ushort wSlaveAddress, bool bSlavePDIAccessEnable, bool bForceAssign, uint dwTimeout)
Requests EEPROM Assignment to PDI or EtherCAT Master operation and returns immediately.
EC_NOTIFY_EEPROM_OPERATION is given on completion or timeout. This function may be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_EEPROM_OPERATION_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param bSlavePDIAccessEnable:
EC_TRUE: EEPROM assigned to slave PDI application, EC_FALSE: EEPROM assigned to EC-Master
- Param bForceAssign:
Force Assignment of EEPROM (only for ECat Master Assignment)
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError ActiveSlaveEEPRom (bool bFixedAddressing, ushort wSlaveAddress, out bool pbSlavePDIAccessActive, uint dwTimeout)
Check whether EEPROM is marked access active by Slave PDI application.
This function may not be called from within the JobTask’s context.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pbSlavePDIAccessActive:
Pointer to Boolean value: EC_TRUE: EEPROM active by PDI application, EC_FALSE: EEPROM not active
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError ActiveSlaveEEPRomReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, ushort wSlaveAddress, out bool pbSlavePDIAccessActive, uint dwTimeout)
Requests EEPROM is marked access active by Slave PDI application check and returns immediately.
An EC_NOTIFY_EEPROM_OPERATION is given on completion or timeout. This function may be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_EEPROM_OPERATION_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pbSlavePDIAccessActive:
Pointer to Boolean value: EC_TRUE: EEPROM active by PDI application, EC_FALSE: EEPROM not active. Must be valid until operation complete.
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time. The timeout value must not be set to EC_NOWAIT.
- Return:
EC_E_NOERROR or error code
- ECError HCAcceptTopoChange ()
Accept last detected topology change.
If Hot connect is configured in manual mode by EC_IOCTL_HC_SETMODE, the master will generate the notifications EC_NOTIFY_HC_PROBEALLGROUPS or EC_NOTIFY_HC_DETECTADDGROUPS after a topology change was detected. This function will set all new detected slaves to the current master state.
- Return:
EC_E_NOERROR or error code
- ECError HCGetNumGroupMembers (uint dwGroupIndex)
Get number of slaves belonging to a specific Hot-Connect group.
- Param dwGroupIndex:
Index of Hot-Connect group, 0 is the mandatory group
- Return:
Number of slaves
- ECError HCGetSlaveIdsOfGroup (uint dwGroupIndex, out uint adwSlaveId, uint dwMaxNumSlaveIds)
Get a list of Slave ID’s belonging to a specific Hot-Connect group.
- Param dwGroupIndex:
Index of Hot-Connect group, 0 is the mandatory group
- Param adwSlaveId:
Preallocated Slave ID list buffer
- Param dwMaxNumSlaveIds:
Size of Slave ID list buffer
- Return:
EC_E_NOERROR or error code
- ECError GetHcGroupNumOf ()
Get number of Hot-Connect groups.
- Return:
number of HC groups
- ECError GetHcGroupInfo (uint dwHcGroupIdx, DN_EC_T_HC_GROUP_INFO pHcGroupInfo)
Get informations of a specific Hot-Connect group.
- Param dwHcGroupIdx:
- Param pHcGroupInfo:
Hot connect group info
- Return:
EC_E_NOERROR or error code
- ECError SetSlavePortState (uint dwSlaveId, ushort wPort, bool bClose, bool bForce, uint dwTimeout)
Open or close slave port.
This function allows to open or close a specific slave port in different ways. It can also be used to re-open ports closed by a rescue scan.
- Param dwSlaveId:
Slave ID
- Param wPort:
Port to open or close. Can be ESC_PORT_A, ESC_PORT_B, ESC_PORT_C, ESC_PORT_D.
- Param bClose:
EC_TRUE: close port, EC_FALSE: open port
- Param bForce:
EC_TRUE: port will be closed or open, EC_FALSE: port will be set in AutoClose mode
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError SetSlavePortStateReq (uint dwClientId, uint dwTferId, uint dwSlaveId, ushort wPort, bool bClose, bool bForce, uint dwTimeout)
Requests Open or close slave port operation and returns immediately.
An EC_T_PORT_OPERATION_NTFY_DESC is given on completion. This function can be called to re-open ports closed by a rescue scan.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_PORT_OPERATION_NTFY_DESC.
- Param dwSlaveId:
Slave ID
- Param wPort:
Port to open or close. Can be ESC_PORT_A, ESC_PORT_B, ESC_PORT_C, ESC_PORT_D.
- Param bClose:
EC_TRUE: close port, EC_FALSE: open port
- Param bForce:
EC_TRUE: port will be closed or open, EC_FALSE: port will be set in AutoClose mode
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
- ECError SlaveSerializeMbxTfers (uint dwSlaveId)
Serializes all mailbox transfers to the specified slave.
The parallel (overlapped) usage of more than one protocol (CoE, EoE, FoE, etc.) will be disabled. By default parallel mailbox transfers are enabled.
- Param dwSlaveId:
Slave ID
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave does not support mailbox transfers
- ECError SlaveParallelMbxTfers (uint dwSlaveId)
Re-enable the parallel mailbox transfers to the specified slave.
Allows parallel (overlapped) usage of more than one protocol (CoE, EoE, FoE, etc.). By default parallel mailbox transfers are enabled.
- Param dwSlaveId:
Slave ID
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
EC_E_NO_MBX_SUPPORT if slave does not support mailbox transfers
- ECError DcEnable ()
Enable DC Support.
- Return:
EC_E_NOERROR or error code
- ECError DcDisable ()
Disable DC Support.
- Return:
EC_E_NOERROR or error code
- ECError DcIsEnabled (out bool pbDcIsEnabled)
Determines if DC is enabled and used.
- Param pbDcIsEnabled:
EC_TRUE if DC is enabled
- Return:
EC_E_NOERROR or error code
- ECError DcConfigure (DN_EC_T_DC_CONFIGURE pDcConfigure)
Configure the distributed clocks.
Set the DC synchronization settling time ([ms]).
Set the DC slave limit for the wire or’ed clock deviation value. This value determines whether the slave clocks are synchronized or not.
Configure the ARMW burst frames to compensate the static deviations of the clock speeds.
- Param pDcConfigure:
Configuration parameter a pointer to a structure of type EC_T_DC_CONFIGURE
- Return:
EC_E_NOERROR or error code
- ECError DcContDelayCompEnable ()
Enable the continuous propagation delay compensation.
Calling this function will generate a propagation delay measurement every 30s. The result of the measurement is used to correct the propagation delay values on the bus.
- Return:
EC_E_NOERROR or error code
- ECError DcContDelayCompDisable ()
Disable the continuous propagation delay compensation.
- Return:
EC_E_NOERROR or error code
- ECError DcmConfigure (DN_EC_T_DCM_CONFIG pDcmConfig, uint dwInSyncTimeout)
Configure DC master synchronization.
- Param pDcmConfig:
Configuration information, a pointer to a structure of type EC_T_DCM_CONFIG
- Param dwInSyncTimeout:
Currently not implemented
- Return:
EC_E_NOERROR or error code
- ECError DcmGetStatus (out uint pdwErrorCode, out int pnDiffCur, out int pnDiffAvg, out int pnDiffMax)
Get DC master synchronization controller status.
- Param pdwErrorCode:
Pointer to current error code of the DCM controller. Possible values are:
- Param pnDiffCur:
Pointer to current difference between set value and actual value of controller in nanoseconds
- Param pnDiffAvg:
Pointer to average difference between set value and actual value of controller in nanoseconds
- Param pnDiffMax:
Pointer to maximum difference between set value and actual value of controller in nanoseconds
- Return:
EC_E_NOERROR if status retrieval was successful
EC_E_NOTSUPPORTED if the DC feature is not supported/switched off. EC-Master stack has to be compiled with DC support see “define INCLUDE_DC_SUPPORT”.
EC_NULL does not appear in normal flow, if EC_NULL is returned we are in a very exceptional case where m_poDcm == NULL (SW error detection)
- ECError DcxGetStatus (out uint pdwErrorCode, out int pnDiffCur, out int pnDiffAvg, out int pnDiffMax, out long pnTimeStampDiff)
Get DC master external synchronization controller status.
- Param pdwErrorCode:
DCX controller error code
- Param pnDiffCur:
Current difference between set value and actual value of controller in nanoseconds
- Param pnDiffAvg:
Average difference between set value and actual value of controller in nanoseconds
- Param pnDiffMax:
Maximum difference between set value and actual value of controller in nanoseconds
- Param pnTimeStampDiff:
Difference between external and internal timestamps
- Return:
EC_E_NOERROR or error code
- ECError DcmResetStatus ()
Reset DC master synchronization controller status, average and maximum difference between set value and actual value.
- Return:
EC_E_NOERROR or error code
- ECError DcmGetBusShiftConfigured (out bool pbBusShiftConfigured)
Determines if DCM Bus Shift is configured/possible in configuration (ENI file).
- Param pbBusShiftConfigured:
EC_TRUE if DCM bus shift mode is supported by the current configuration
- Return:
EC_E_NOERROR or error code
- ECError DcmShowStatus ()
Show DC master synchronization status as DbgMsg (for development purposes only).
- Return:
EC_E_NOERROR or error code
- ECError DcmGetAdjust (out int pnAdjustPermil)
Returns the current adjustment value for the timer.
bCtlOff must be set to EC_TRUE in EC_T_DCM_CONFIG to enable external adjustment.
- Param pnAdjustPermil:
Current adjustment value of the timer
- Return:
EC_E_NOERROR or error code
- ECError GetSlaveInfo (bool bFixedAddressing, ushort wSlaveAddress, out DN_EC_T_GET_SLAVE_INFO pGetSlaveInfo)
Get Slave Info.
Use emGetCfgSlaveInfo or emGetBusSlaveInfo instead
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pGetSlaveInfo:
Slave information
- Return:
EC_E_NOERROR or error code
- ECError GetCfgSlaveInfo (bool bStationAddress, ushort wSlaveAddress, out DN_EC_T_CFG_SLAVE_INFO pSlaveInfo)
Return information about a configured slave from the ENI file.
- Param bStationAddress:
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pSlaveInfo:
Information about the slave
- Return:
EC_E_NOERROR or error code
- ECError GetCfgSlaveEoeInfo (bool bStationAddress, ushort wSlaveAddress, out DN_EC_T_CFG_SLAVE_EOE_INFO pSlaveEoeInfo)
Return EoE information about a configured slave from the ENI file.
- Param bStationAddress:
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pSlaveEoeInfo:
Information about the slave
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_NO_MBX_SUPPORT if the slave does not support mailbox communication
EC_E_NO_EOE_SUPPORT if the slave supports mailbox communication, but not EoE
- ECError GetCfgSlaveSmInfo (bool bStationAddress, ushort wSlaveAddress, DN_EC_T_CFG_SLAVE_SM_INFO pSlaveSmInfo)
Return SyncManager information of a configured slave from the ENI file.
- Param bStationAddress:
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pSlaveSmInfo:
Information about the slave.
- Return:
EC_E_NOERROR or error code
- ECError GetBusSlaveInfo (bool bStationAddress, ushort wSlaveAddress, out DN_EC_T_BUS_SLAVE_INFO pSlaveInfo)
Return information about a slave connected to the EtherCAT bus.
- Param bStationAddress:
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pSlaveInfo:
Information from the slave
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
- ECError GetSlaveInpVarInfoNumOf (bool bFixedAddressing, ushort wSlaveAddress, out ushort pwSlaveInpVarInfoNumOf)
Gets the number of input variables of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pwSlaveInpVarInfoNumOf:
Number of found process variable entries
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointer is EC_NULL
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
- ECError GetSlaveOutpVarInfoNumOf (bool bFixedAddressing, ushort wSlaveAddress, out ushort pwSlaveOutpVarInfoNumOf)
Gets the number of output variables of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param pwSlaveOutpVarInfoNumOf:
Number of found process variables
- Return:
EC_E_NOERROR or error code
- ECError GetSlaveInpVarInfo (bool bFixedAddressing, ushort wSlaveAddress, ushort wNumOfVarsToRead, out DN_EC_T_PROCESS_VAR_INFO[] pSlaveProcVarInfoEntries, out ushort pwReadEntries)
Gets the number of input variables of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wNumOfVarsToRead:
- Param pSlaveProcVarInfoEntries:
- Param pwReadEntries:
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointer is EC_NULL
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
- ECError GetSlaveInpVarInfoEx (bool bFixedAddressing, ushort wSlaveAddress, ushort wNumOfVarsToRead, out DN_EC_T_PROCESS_VAR_INFO_EX[] pSlaveProcVarInfoEntries, out ushort pwReadEntries)
Gets the input process variable extended information entries of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wNumOfVarsToRead:
Number process variable entries that have been stored in pSlaveProcVarInfoEntries
- Param pSlaveProcVarInfoEntries:
Number process variable entries that have been stored in pSlaveProcVarInfoEntries
- Param pwReadEntries:
The number of read process variable information entries
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointer is EC_NULL
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
- ECError GetSlaveOutpVarInfo (bool bFixedAddressing, ushort wSlaveAddress, ushort wNumOfVarsToRead, out DN_EC_T_PROCESS_VAR_INFO[] pSlaveProcVarInfoEntries, out ushort pwReadEntries)
Gets the number of output variables of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wNumOfVarsToRead:
- Param pSlaveProcVarInfoEntries:
- Param pwReadEntries:
- Return:
EC_E_NOERROR or error code
- ECError GetSlaveOutpVarInfoEx (bool bFixedAddressing, ushort wSlaveAddress, ushort wNumOfVarsToRead, out DN_EC_T_PROCESS_VAR_INFO_EX[] pSlaveProcVarInfoEntries, out ushort pwReadEntries)
Gets the output process variable extended information entries of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wNumOfVarsToRead:
Number of process variable information entries
- Param pSlaveProcVarInfoEntries:
The read process extended variable entries
- Param pwReadEntries:
The number of read process variable information entries
- Return:
EC_E_NOERROR or error code
- ECError GetSlaveOutpVarByObjectEx (bool bFixedAddressing, ushort wSlaveAddress, ushort wIndex, ushort wSubIndex, out DN_EC_T_PROCESS_VAR_INFO_EX pProcessVarInfoEntry)
Gets the input process variable extended information entry by object index, subindex of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wIndex:
Object index
- Param wSubIndex:
Object sub index
- Param pProcessVarInfoEntry:
Process variable extended information entry
- Return:
EC_E_NOERROR or error code
- ECError GetSlaveInpVarByObjectEx (bool bFixedAddressing, ushort wSlaveAddress, ushort wIndex, ushort wSubIndex, out DN_EC_T_PROCESS_VAR_INFO_EX pProcessVarInfoEntry)
Gets the input process variable extended information entry by object index, subindex of a specific slave.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wIndex:
Object index
- Param wSubIndex:
Object sub index
- Param pProcessVarInfoEntry:
Process variable extended information entry
- Return:
EC_E_NOERROR or error code
- ECError FindOutpVarByName (string szVariableName, out DN_EC_T_PROCESS_VAR_INFO pSlaveOutpVarInfo)
Finds an output process variable information entry by the variable name.
- Param szVariableName:
Variable name
- Param pSlaveOutpVarInfo:
- Return:
EC_E_NOERROR or error code
- ECError FindOutpVarByNameEx (string szVariableName, out DN_EC_T_PROCESS_VAR_INFO_EX pProcessVarInfoEntry)
Finds an output process variable extended information entry by the variable name.
- Param szVariableName:
Variable name
- Param pProcessVarInfoEntry:
Process variable extended information entry
- Return:
EC_E_NOERROR or error code
- ECError FindInpVarByName (string szVariableName, out DN_EC_T_PROCESS_VAR_INFO pProcessVarInfoEntry)
Finds an input process variable information entry by the variable name.
- Param szVariableName:
Variable name
- Param pProcessVarInfoEntry:
Process variable information entry
- Return:
EC_E_NOERROR or error code
- ECError FindInpVarByNameEx (string szVariableName, out DN_EC_T_PROCESS_VAR_INFO_EX pProcessVarInfoEntry)
Finds an input process variable extended information entry by the variable name.
- Param szVariableName:
Variable name
- Param pProcessVarInfoEntry:
Process variable extended information entry
- Return:
EC_E_NOERROR or error code
- ECError EthDbgMsg (byte byEthTypeByte0, byte byEthTypeByte1, string szMsg)
Send a debug message to the EtherCAT Link Layer.
This feature can be used for debugging purposes.
- Param byEthTypeByte0:
Ethernet type byte 0
- Param byEthTypeByte1:
Ethernet type byte 1
- Param szMsg:
Message to send to link layer
- Return:
EC_E_NOERROR or error code
- ECError BlockNode (DN_EC_T_SB_MISMATCH_DESC pMisMatch, uint dwTimeout)
Blocks a slave on a specific port.
If an invalid slave node is connected, which causes the bus topology scan to fail, the previous port, where this node is connected to can be shut down with this call. This allows a Hot-Connect system to not be disturbed, if unknown nodes are connected. If this function will be executed on a Hot-Connect member (a slave which is part of a hot connect group) the complete hot connect group will be excluded from the bus. This function may only be called from within the JobTask’s context with parameter dwTimeout set to EC_NOWAIT.
- Param pMisMatch:
Pointer to EC_T_SB_MISMATCH_DESC carrying mismatch descriptor.
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR or error code
- ECError OpenBlockedPorts (uint dwTimeout)
Opens all blocked ports.
This call allows re-opening all blocked ports to check whether mismatch cause is removed from bus. This function may only be called from within the JobTask’s context with parameter dwTimeout set to EC_NOWAIT.
- Param dwTimeout:
Timeout [ms]. The function will block at most for this time.
- Return:
EC_E_NOERROR or error code
- ECError ForceTopologyChange ()
Force changed topology.
Trigger HC State Machine.
- Return:
EC_E_NOERROR or error code
- ECError IsTopologyChangeDetected (out bool pbTopologyChangeDetected)
Returns whether topology change detected.
- Param pbTopologyChangeDetected:
Pointer to EC_T_BOOL value: EC_TRUE if Topology Change Detected, EC_FALSE if not
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError IsTopologyKnown (out bool pbTopologyKnown)
Returns whether topology known.
- Param pbTopologyKnown:
Topology known
- Return:
EC_E_NOERROR or error code
- ECError GetBusTime (out ulong pqwBusTime)
This function returns the actual bus time in nanoseconds.
- Param pqwBusTime:
Bus time [ns]
- Return:
EC_E_NOERROR or error code
- ECError IsSlavePresent (uint dwSlaveId, out bool pbPresence)
Returns whether a specific slave is currently connected to the Bus.
This function may be called from within the JobTask.
- Param dwSlaveId:
Slave ID
- Param pbPresence:
EC_TRUE if the slave is currently connected to the bus, EC_FALSE if not
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTFOUND if no slave matching dwSlaveId can be found
- DN_EC_PTS_STATE PassThroughSrvGetStatus ()
Gets the status of the Pass-through server.
- Return:
EC_E_NOERROR or error code
- ECError PassThroughSrvStart (DN_EC_T_PTS_SRV_START_PARMS poPtsStartParams, uint dwTimeout)
Starts the Pass Through Server.
- Param poPtsStartParams:
Pass through server start parameter
- Param dwTimeout:
Timeout
- Return:
EC_E_NOERROR or error code
- ECError PassThroughSrvStop (uint dwTimeout)
Stops the Pass Through Server.
- Param dwTimeout:
Timeout
- Return:
EC_E_NOERROR or error code
- ECError PassThroughSrvEnable (uint dwTimeout)
Enables the Pass-through server.
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError PassThroughSrvDisable (uint dwTimeout)
Disables the Pass-through server.
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR or error code
- ECError AdsAdapterStart (DN_EC_T_ADS_ADAPTER_START_PARMS poStartParams, uint dwTimeout)
Starts the ADS Pass Through Server.
#EC_E_NOERROR if successful
#EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
#EC_E_INVALIDPARM if dwInstanceID is out of range, the input pointer is EC_NULL or contains EC_NULL pointer
#EC_E_NOMEMORY if the mailbox protocol queue of the slave if full
#EC_E_ADS_IS_RUNNING if the ADS server is running
- Param poStartParams:
Pass through server start parameter
- Param dwTimeout:
Timeout
- Return:
- ECError AdsAdapterStop (uint dwTimeout)
Stops the ADS Pass Through Server.
- Param dwTimeout:
Timeout
- Return:
EC_E_NOERROR or error code
- ECError GetDiagnosisImageSize ()
Gets the diagnosis image size.
- Return:
Diagnosis image size
- ECError GetSrcMacAddress (out DN_ETHERNET_ADDRESS pMacSrc)
Gets the source MAC address.
- Param pMacSrc:
6-byte buffer to write source MAC address to
- Return:
EC_E_NOERROR or error code
- ECError GetLicenseFingerprint (byte byMethod, string szLicenseFingerprint)
Gets the fingerprint needed for license key generation.
- Param byMethod:
Method used to generate the fingerprint
- Param szLicenseFingerprint:
Buffer for fingerprint string. Size must be at least EC_LICENSE_FINGERPRINT_STRSIZE.
- Return:
EC_E_NOERROR or error code
- ECError SetLicenseKey (string 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.
- Param szLicenseKey:
License key as zero terminated string with 26, 53 or 56 characters
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_INVALIDSIZE if the format of the license key is wrong. The correct length is 26, 53 or 56 characters.
EC_E_LICENSE_MISSING if the license key doesn’t match the MAC Address
- ECError GetVersion (out uint pdwVersion, out uint pdwVersionType)
Gets the version information.
- Param pdwVersion:
Pointer to EC_T_DWORD to carry out version number as a 32-bit value
- Param pdwVersionType:
Pointer to EC_T_DWORD to carry out version type. See EC_VERSION_TYPES “EC_VERSION_TYPE”.
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the output pointer is EC_NULL
- ECError TraceDataConfig (ushort wTraceDataSize)
Configures a trace data buffer and enables it for transmission.
Must be called after initialization and before configuration.
If wTraceDataSize is too large, configuration will fail with return code #EC_E_XML_CYCCMDS_SIZEMISMATCH.
- Param wTraceDataSize:
Size of Trace Data in bytes
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTSUPPORTED if eCycFrameLayout_FIXED is configured
- ECError TraceDataGetInfo (DN_EC_T_TRACE_DATA_INFO pTraceDataInfo)
Get information about the offset and size of trace data.
The trace data buffer is located in EC_T_TRACE_DATA_INFO.pbyData at the byte offset EC_T_TRACE_DATA_INFO.dwOffset.
- Param pTraceDataInfo:
Information about trace data
- Return:
EC_E_NOERROR or error code
- ECError FastModeInit ()
- Return:
- ECError FastSendAllCycFrames ()
- Return:
- ECError FastProcessAllRxFrames (out bool pbAreAllCycFramesProcessed)
- Param pbAreAllCycFramesProcessed:
- Return:
- ECError ReadSlaveIdentification (bool bFixedAddressing, ushort wSlaveAddress, ushort wAdo, out ushort pwValue, uint dwTimeout)
Read identification value from a slave.
This function may not be called from within the JobTask’s context.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wAdo:
ADO used for identification command
- Param pwValue:
Pointer to Word value containing the Identification value
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_TIMEOUT if dwTimeout elapsed during the API call
EC_E_BUSY if another transfer request is already pending or the master or the corresponding slave is currently changing its operational state
EC_E_NOTREADY if the working counter was not set when sending the command (slave may not be connected or did not respond)
EC_E_ADO_NOT_SUPPORTED if the slave does not support requesting ID mechanism
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError ReadSlaveIdentificationReq (uint dwClientId, uint dwTferId, bool bFixedAddressing, ushort wSlaveAddress, ushort wAdo, out ushort pwValue, uint dwTimeout)
Request the identification value from a slave and returns immediately.
A notification EC_NOTIFY_SLAVE_IDENTIFICATION is given on completion or timeout. This function may be called from within the JobTask’s context.
- Param dwClientId:
Client ID returned by RegisterClient (0 if all registered clients shall be notified)
- Param dwTferId:
Transfer ID. The application can set this ID to identify the transfer. It will be passed back to the application within EC_T_SLAVE_IDENTIFICATION_NTFY_DESC.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param wAdo:
ADO used for identification command
- Param pwValue:
Pointer to Word value containing the Identification value, must be valid until the request complete.
- Param dwTimeout:
Timeout [ms]
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or the command is not supported or the timeout value is set to EC_NOWAIT
EC_E_SLAVE_NOT_PRESENT if slave not present
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
EC_E_ADO_NOT_SUPPORTED if the slave does not support requesting ID mechanism
- ECError SetSlaveDisabled (bool bFixedAddressing, ushort wSlaveAddress, bool bDisabled)
Enable or disable a specific slave.
The EtherCAT state of disabled slaves cannot be set higher than PREOP. If the state is higher than PREOP at the time this function is called the state will be automatically changed to PREOP. The information about the last requested state is lost and is set to PREOP too.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param bDisabled:
EC_TRUE: Disable slave, EC_FALSE: Enable slave
- Return:
EC_E_NOERROR or error code
- ECError SetSlavesDisabled (bool bFixedAddressing, ushort wSlaveAddress, DN_EC_T_SLAVE_SELECTION eSlaveSelection, bool bDisabled)
Enable or disable a specific group of slaves.
The EtherCAT state of disabled slaves cannot be set higher than PREOP. If the state is higher than PREOP at the time this function is called, the state will be automatically change to PREOP. The information about the last requested state is lost and is set to PREOP too.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param eSlaveSelection:
Slave selection criteria for following slaves
- Param bDisabled:
EC_TRUE: Disable slaves, EC_FALSE: Enable slaves
- Return:
EC_E_NOERROR or error code
- ECError SetSlaveDisconnected (bool bFixedAddressing, ushort wSlaveAddress, bool bDisconnected)
Mark specific slave for connection or disconnection.
The EtherCAT state of disconnected slaves cannot be set higher than INIT. If the state is higher than INIT at the time this function is called, the state will be automatically changed to INIT. The information about the last requested state is lost and is set to INIT too.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param bDisconnected:
EC_TRUE: Mark slave for disconnection, EC_FALSE: Mark slave for (re-)connection
- Return:
EC_E_NOERROR or error code
- ECError SetSlavesDisconnected (bool bFixedAddressing, ushort wSlaveAddress, DN_EC_T_SLAVE_SELECTION eSlaveSelection, bool bDisconnected)
Mark a specific group of slaves for connection or disconnection.
- Param bFixedAddressing:
EC_TRUE: use station address, EC_FALSE: use AutoInc address
- Param wSlaveAddress:
Slave address according bFixedAddressing
- Param eSlaveSelection:
Slave selection criteria
- Param bDisconnected:
EC_TRUE: mark slaves for disconnection, EC_FALSE: mark slaves for connection
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range
EC_E_NOTFOUND if no slave matching bFixedAddressing / wSlaveAddress can be found
- ECError GetMemoryUsage (out uint pdwCurrentUsage, out uint pdwMaxUsage)
Returns information about memory usage.
All calls to malloc/free and new/delete are monitored.
- Param pdwCurrentUsage:
Current memory usage in Bytes at the time where this function is called
- Param pdwMaxUsage:
Maximum memory usage in Bytes since initialization at the time where this function is called
- Return:
EC_E_NOERROR or error code
- ECError GetSlaveStatistics (uint dwSlaveId, out DN_EC_T_SLVSTATISTICS_DESC pSlaveStatisticsDesc)
Get Slave’s statistics counter.
- Param dwSlaveId:
Slave id
- Param pSlaveStatisticsDesc:
Pointer to structure EC_T_SLVSTATISTICS_DESC
- Return:
EC_E_NOERROR or error code
- ECError ClearSlaveStatistics (uint dwSlaveId)
Clears all error registers of a slave.
- Param dwSlaveId:
Slave Id, INVALID_SLAVE_ID clears all slaves
- Return:
EC_E_NOERROR or error code
- uint GetMasterSyncUnitInfoNumOf ()
Get number of Master Sync Units info entries.
- Return:
Number of Master Sync Units info entries
- ECError GetMasterSyncUnitInfo (ushort wMsuId, out DN_EC_T_MSU_INFO pMsuInfo)
Get number of Master Sync Units info entries.
- Param wMsuId:
- Param pMsuInfo:
- Return:
Number of Master Sync Units info entries
- ECError GetMasterDump (byte[] pbyBuffer, uint dwBufferSize, out uint pdwDumpSize)
The dump contains relevant information about the master and slave status.
The dump is only intended for internal troubleshooting at acontis. Amongst others it contains the following descriptors:
EC_T_INIT_MASTER_PARMS
EC_T_BUS_DIAGNOSIS_INFO
EC_T_MAILBOX_STATISTICS
EC_T_CFG_SLAVE_INFO
EC_T_BUS_SLAVE_INFO
EC_T_SLVSTATISTICS_DESC
The buffer is written until all relevant data have been dumped or the buffer size has been exceeded.
- Param pbyBuffer:
Preallocated buffer to dump log data
- Param dwBufferSize:
Size of preallocated buffer
- Param pdwDumpSize:
Size of master dump
- Return:
EC_E_NOERROR
EC_E_NOMEMORY if buffer too small
- ECError BadConnectionsDetect (bool bRefreshSlaveStatistics, uint dwTimeout)
Detects bad connections.
Analyzes the slave ESC error counters:
Invalid Frame Counter (0x0300),
RX Error Counter (0x0301),
Lost Link Counter (0x0310),
whether there is a problem in the area PHY - connector - cable - connector - PHY. If one of the above error counters shows a value not equal to zero, an EC_NOTIFY_BAD_CONNECTION is generated, which contains the exact position of the faulty connection.
- Param bRefreshSlaveStatistics:
- Param dwTimeout:
Timeout [ms]. not be EC_NOWAIT!
- Return:
EC_E_NOERROR or error code
- ECError SelfTestScan (DN_EC_T_SELFTESTSCAN_PARMS pParms)
Self test scan.
Send a burst of numerous frames and analyze the slave connections. After deactivating the job task, frames will be sent as fast as the LinkLayer can send them. The size of the frames increases and decreases between the defined limits. Dependent on the parameters the BadConnectionsDetect API will analyze the slave connections.
- Param pParms:
Self-test scan parameters
- Return:
EC_E_NOERROR if successful
EC_E_INVALIDSTATE if EtherCAT stack isn’t initialized
EC_E_INVALIDPARM if dwInstanceID is out of range or pParms is NULL or contains values out of range
EC_E_BAD_CONNECTION if bad connection was detected
EC_E_FRAME_LOST if frame(s) lost during self-test
EC_E_NOTSUPPORTED if not in polling mode
EC_E_MASTER_RED_STATE_INACTIVE if Master Redundancy is configured and master is inactive
- ECError LinkInputVarByName (string szVarName, DN_EC_T_LINK_VAR_INFO pLinkVarInfo)
Link application variable to input process image. Input process variable is given by its name.
- Param szVarName:
Name of variable
- Param pLinkVarInfo:
Information about linked variable
- Return:
EC_E_NOERROR or an error code
- ECError LinkInputVarByObject (bool bFixedAddressing, ushort wSlaveAddress, ushort wIndex, ushort wSubIndex, DN_EC_T_LINK_VAR_INFO pLinkVarInfo)
Link application variable to input process image. Input process variable is given by its object index and subindex of a specific slave.
- Param bFixedAddressing:
Use station address if EC_TRUE. Otherwise use AutoInc address.
- Param wSlaveAddress:
Slave address according to bFixedAddressing
- Param wIndex:
Object index
- Param wSubIndex:
Object subindex
- Param pLinkVarInfo:
Information about linked variable
- Return:
EC_E_NOERROR or an error code
- ECError LinkOutputVarByName (string szVarName, DN_EC_T_LINK_VAR_INFO pLinkVarInfo)
Link application variable to output process image. Output process variable is given by its name.
- Param szVarName:
Name of variable
- Param pLinkVarInfo:
Information about linked variable
- Return:
EC_E_NOERROR or an error code
- ECError LinkOutputVarByObject (bool bFixedAddressing, ushort wSlaveAddress, ushort wIndex, ushort wSubIndex, DN_EC_T_LINK_VAR_INFO pLinkVarInfo)
Link application variable to output process image. Output process variable is given by its object index and subindex of a specific slave.
- Param bFixedAddressing:
Use station address if EC_TRUE. Otherwise use AutoInc address.
- Param wSlaveAddress:
Slave address according to bFixedAddressing
- Param wIndex:
Object index
- Param wSubIndex:
Object subindex
- Param pLinkVarInfo:
Information about linked variable
- Return:
EC_E_NOERROR or an error code
- ECError EoeSendFrame (ushort wCfgFixedAddress, byte[] pbyFrame, uint dwFrameLen)
Send EoE frame (queued)
- Param wCfgFixedAddress:
- Param pbyFrame:
- Param dwFrameLen:
- Return:
_ #EC_E_NOERROR or error code
Properties
Events
Public Static Functions
- bool IsRemoteServerUp (byte[] abyIpAddr, ushort wPort)
Checks if remote server is up by sending a “ping”.
- Param abyIpAddr:
IPAddress
- Param wPort:
Port
- Return:
true, if server is up, else false if server is down
- void CopyStream (Stream source, Stream target)
Copy a stream.
- Param source:
Source.
- Param target:
Target.
- ECError CreateObjectFromBytes (byte[] bytes, ref object obj)
Creates object from byte array.
- Param bytes:
Object data as byte array
- Param obj:
Object which should be filled
- Return:
Error code
- ECError GetSizeOfObject (object obj, out uint size)
Get byte size of object (as required from CoeSdoUpload)
- Param obj:
Object
- Param size:
Byte size of object
- Return:
Error code
- uint GetBitLenOfDataType (DN_EC_T_DEFTYPE type)
Get bit length of data type.
- Param type:
Data type
- Return:
Bit length
- object RunUnitTest (string cmd, object data)
Run unit test (for internal use)
- Param cmd:
Command
- Param data:
Input data
- Return:
Output data
- ECError ConvValueToBytes (DN_EC_T_DEFTYPE type, object value, out byte[] bytes)
Converts value to bytes.
- Param type:
Data type
- Param value:
Value
- Param bytes:
Bytes
- Return:
Error code
- ECError ConvValueFromBytes (byte[] bytes, DN_EC_T_DEFTYPE type, out object value)
Converts value from bytes.
- Param bytes:
Bytes
- Param type:
Data type
- Param value:
Value
- Return:
Error code
- ECError ReadValueFromBytes (byte[] bytes, uint bitOffset, uint bitLength, DN_EC_T_DEFTYPE type, out object value)
Read value from bytes.
- Param bytes:
Bytes
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param type:
Data type
- Param value:
Value
- Return:
Error code
- ECError ReadValueFromAddress (IntPtr address, uint bitOffset, uint bitLength, DN_EC_T_DEFTYPE type, out object value)
Read value from address.
- Param address:
Address
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param type:
Data type
- Param value:
Value
- Return:
Error code
- ECError WriteValueToBytes (byte[] bytes, uint bitOffset, uint bitLength, DN_EC_T_DEFTYPE type, object value)
Write value to bytes.
- Param bytes:
Bytes
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param type:
Data type
- Param value:
Value
- Return:
Error code
- ECError WriteValueToAddress (IntPtr address, uint bitOffset, uint bitLength, DN_EC_T_DEFTYPE type, object value)
Write value to address.
- Param address:
Address
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param type:
Data type
- Param value:
Value
- Return:
Error code
- object ConvValueFromString (DN_EC_T_DEFTYPE type, string value)
Converts value from string.
- Param type:
Type
- Param value:
Value
- Return:
Value as object
- string ConvValueToString (DN_EC_T_DEFTYPE type, object value)
Converts value to string.
- Param type:
Type
- Param value:
Value
- Return:
Value as string
- string ConvStringFromByteArray (byte[] data)
Converts byte array to string (e.g. 01 02)
- Param data:
Data
- Return:
Data as string
- byte[] ConvStringToByteArray (string data)
Converts byte array from string (e.g. 01 02)
- Param data:
Data
- Return:
Data as byte array
- void ReadPdBitsFromAddress (IntPtr address, uint bitOffset, uint bitLength, out byte[] pdBits)
Reads process data bits from address.
- Param address:
Address
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param pdBits:
[out] Process data bits
- void WritePdBitsToAddress (IntPtr address, uint bitOffset, uint bitLength, byte[] pdBits)
Writes process data bits to address.
- Param address:
Address
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param pdBits:
Process data bits
- void ReadPdBitsFromBytes (byte[] bytes, uint bitOffset, uint bitLength, out byte[] pdBits)
Reads process data bits from bytes.
- Param bytes:
Bytes
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param pdBits:
[out] Process data bits
- void WritePdBitsToBytes (byte[] bytes, uint bitOffset, uint bitLength, byte[] pdBits)
Writes process data bits to bytes.
- Param bytes:
Bytes
- Param bitOffset:
Bit offset
- Param bitLength:
Bit length
- Param pdBits:
Process data bits
- void ReadPdBytesFromAddress (IntPtr address, uint offset, uint length, out byte[] pdBytes)
Reads process data bytes from address.
- Param address:
Address
- Param offset:
Offset
- Param length:
Length
- Param pdBytes:
[out] Process data bytes
- void WritePdBytesToAddress (IntPtr address, uint offset, byte[] pdBytes)
Writes process data bytes to address.
- Param address:
Address
- Param offset:
Offset
- Param pdBytes:
Process data bytes