10.4. Status notifications

10.4.1. emonNotify - EC_NOTIFY_STATECHANGED

Notification about a change in the MainDevice’s operational state.

emonNotify - EC_NOTIFY_STATECHANGED
Parameter
  • pbyInBuf: [in] Pointer to data of type EC_T_STATECHANGE which contains the old and the new MainDevice operational state

  • dwInBufSize: [in] Size of the input buffer provided at pbyInBuf in bytes

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

struct EC_T_STATECHANGE

Public Members

EC_T_STATE oldState

Old operational state

EC_T_STATE newState

New operational state

10.4.2. emonNotify - EC_NOTIFY_SB_STATUS

Scan bus status notification.

emonNotify - EC_NOTIFY_SB_STATUS
Parameter
  • pbyInBuf: [in] Pointer to EC_T_SB_STATUS_NTFY_DESC

  • dwInBufSize: [in] Size of the input buffer provided at pbyInBuf in bytes

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

struct EC_T_SB_STATUS_NTFY_DESC

Public Members

EC_T_DWORD dwResultCode

[in] EC_E_NOERROR: success, EC_E_NOTREADY: no bus scan executed, EC_E_BUSCONFIG_MISMATCH: bus configuration mismatch result of scanbus

EC_T_DWORD dwSlaveCount

[in] Number of slaves connected to the bus

10.4.3. emonNotify - EC_NOTIFY_SB_MISMATCH

This notification is triggered when the bus scan detects a discrepancy between connected SubDevices and configuration due to unexpected SubDevices or missing mandatory SubDevices. In case of permanent frame loss no SubDevices can be found although the SubDevices are connected.

emonNotify - EC_NOTIFY_SB_MISMATCH
Parameter
  • pbyInBuf: [in] Pointer to EC_T_SB_MISMATCH_DESC

  • dwInBufSize: [in] Size of the input buffer provided at pbyInBuf in bytes

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

struct EC_T_SB_MISMATCH_DESC

Public Members

EC_T_WORD wPrevFixedAddress

[in] Previous slave station address

EC_T_WORD wPrevPort

[in] Previous slave station address

EC_T_WORD wPrevAIncAddress

[in] Previous slave auto-increment address

EC_T_WORD wBusAIncAddress

[in] Unexpected slave (bus) auto-inc address

EC_T_DWORD dwBusVendorId

[in] Unexpected slave (bus) vendor ID

EC_T_DWORD dwBusProdCode

[in] Unexpected slave (bus) product code

EC_T_DWORD dwBusRevisionNo

[in] Unexpected slave (bus) revision number

EC_T_DWORD dwBusSerialNo

[in] Unexpected slave (bus) serial number

EC_T_WORD wBusFixedAddress

[in] Unexpected slave (bus) station address

EC_T_BOOL bIdentificationError

[in] Identification command sent to slave but failed

EC_T_WORD wIdentificationAdo

[in] Identification register

EC_T_WORD wIdentificationVal

[in] Last identification value read from slave according to the last used identification method

EC_T_WORD wIdentificationValExpected

[in] Identification expected value

EC_T_WORD wCfgFixedAddress

[in] Missing slave (config) station Address

EC_T_WORD wCfgAIncAddress

[in] Missing slave (config) Auto-Increment Address

EC_T_DWORD dwCfgVendorId

[in] Missing slave (config) Vendor ID

EC_T_DWORD dwCfgProdCode

[in] Missing slave (config) Product code

EC_T_DWORD dwCfgRevisionNo

[in] Missing slave (config) Revision Number

EC_T_DWORD dwCfgSerialNo

[in] Missing slave (config) Serial Number

10.4.4. emonNotify - EC_NOTIFY_HC_TOPOCHGDONE

This notification is triggered when a topology change was completely processed.

emonNotify - EC_NOTIFY_HC_TOPOCHGDONE
Parameter
  • pbyInBuf: [in] Pointer to EC_T_DWORD (EC_E_NOERROR on success, Error code otherwise)

  • dwInBufSize: [in] sizeof(EC_T_DWORD)

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

10.4.5. emonNotify - EC_NOTIFY_SLAVE_PRESENCE

This notification is given when a SubDevice appears at or disappears from the network.

emonNotify - EC_NOTIFY_SLAVE_PRESENCE
Parameter
  • pbyInBuf: [in] Pointer to EC_T_SLAVE_PRESENCE_NTFY_DESC

  • dwInBufSize: [in] Size of the input buffer provided at pbyInBuf in bytes

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

Disconnecting the SubDevice from the network, powering it off or a bad connection can produce this notification.

struct EC_T_SLAVE_PRESENCE_NTFY_DESC

Public Members

EC_T_WORD wStationAddress

Slave station address

EC_T_BYTE bPresent

EC_TRUE: present, EC_FALSE: absent

10.4.6. emonNotify - EC_NOTIFY_SLAVE_STATECHANGED

This notification is triggered when a SubDevice has changed its EtherCAT® state. This notification is disabled by default.

emonNotify - EC_NOTIFY_SLAVE_STATECHANGED
Parameter
  • pbyInBuf: [in] Pointer to EC_T_SLAVE_STATECHANGED_NTFY_DESC

  • dwInBufSize: [in] Size of the input buffer provided at pbyInBuf in bytes

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

struct EC_T_SLAVE_STATECHANGED_NTFY_DESC

Public Members

EC_T_SLAVE_PROP SlaveProp

Slave properties

EC_T_STATE newState

New slave state

See also

emonIoCtl - EC_IOCTL_SET_NOTIFICATION_ENABLED to enable notification.

10.4.7. emonNotify - EC_NOTIFY_SLAVE_REGISTER_TRANSFER

This notification is triggered when a SubDevice register transfer is completed.

To avoid excessive triggering of the notification, registers that are read by the EtherCAT® MainDevice at regular intervals are not notified. These are the following registers:

  • AL-Status (0x0130)

  • RX Error Counter, Forwarded RX Error Counter, ECAT Processing Unit Error Counter, PDI Error Counter, PDI Error Code, Lost Link Counter (0x0300:0x0314)

  • SII EEPROM Interface (0x0500:0x050F)

  • Registers above 0x1000

This notification is disabled by default.

emonNotify - EC_NOTIFY_SLAVE_REGISTER_TRANSFER
Parameter
  • pbyInBuf: [in] Pointer to EC_T_SLAVEREGISTER_TRANSFER_NTFY_DESC

  • dwInBufSize: [in] Size of the input buffer provided at pbyInBuf in bytes

  • pbyOutBuf: [out] Should be set to EC_NULL

  • dwOutBufSize: [in] Should be set to 0

  • pdwNumOutData: [out] Should be set to EC_NULL

struct EC_T_SLAVEREGISTER_TRANSFER_NTFY_DESC

Public Members

EC_T_DWORD dwTferId

Transfer ID. For every new slave register transfer a unique ID has to be assigned. This ID can be used after completion to identify the transfer.

EC_T_DWORD dwResult

Result of Slave register transfer

EC_T_BOOL bRead

EC_TRUE: Read register, EC_FALSE: Write register transfer

EC_T_WORD wFixedAddr

Station address of slave

EC_T_WORD wRegisterOffset

Register offset

EC_T_WORD wLen

Length of slave register transfer

EC_T_BYTE *pbyData

Pointer to the data read

EC_T_WORD wWkc

Received working counter

See also

emonIoCtl - EC_IOCTL_SET_NOTIFICATION_ENABLED to enable notification.