# Generic MainDevice Objects: 0x2000-0x20FF ## MainDevice State Change Command Register 0x2000 | **Attribute** | **Value** | |-----------------|-------------------------------------------------------------------------------------------------------| | Name | Master State Change Command | | Object Code | VAR | | Data Type | Unsigned32 | | Category | Customer | | Access | RW | | Value | 0 = invalid 1 = init 2 = pre-operational 3 = bootstrap mode 4 = safe operational 8 = operational | ## MainDevice State Summary 0x2001 | **Attribute** | **Value** | |-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Name | Master State Summary | | Object Code | VAR | | Data Type | Unsigned32 | | Category | Customer | | Access | R | | Value | Bit 0: = 1 MainDevice o.k. Bit 1-3: Reserved Bit 4-7: MainDevice State Bit 8: SubDevices in requested State Bit 9: MainDevice in requested State Bit 10: Bus Scan Match Bit 11: Reserved Bit 12: DC is enabled Bit 13: DC In-Sync Bit 14: DC Busy Bit 15: Reserved Bit 16: Link Up Bit 17-31: Reserved | The parameter data itself (Offset 16ff) consists of a flag field and a bunch of data, defined through flag field: | Parameter Flags Bit 12-15 | Parameter Flags Bit 0-11 | Type of Data | Data | |-----------------------------|-----------------------------------|----------------|--------------------------------------------------| | 0 | CoE DataType e.g. 0x0007 = UINT32 | Data Type | Data defined through CoE DataType | | 1 | Length in Byte | Byte Array | Byte stream byData[Size] | | 2 | Length in Byte | ASCII-String | String szString[Length] (not ‘0’ terminated) | | 3 | Length in Byte | Unicode String | String wszString[Length/2] (not L’0’ terminated) | | 4 | 0 | Text Id | Text Id (Word) | ## Bus Diagnosis Object 0x2002 Object Type: RECORD, Manufacturer Specific Identity 0x40 | **Subindex** | **Description** | **Data Type** | **Access** | **M/O/C** | **Available** | |----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------------|-------------|-----------------| | 0 | Number of Entries | Unsigned8 | R | C | X | | 1 | Reserved | Unsigned16 | R | C | X | | 2 | Configuration Checksum CRC32 | Unsigned32 | R | C | X | | 3 | Number of found Slaves | Unsigned32 | R | C | X | | 4 | Number of found DC Slaves | Unsigned32 | R | C | X | | 5 | Number of Slaves in Configuration | Unsigned32 | R | C | X | | 6 | Number of Mailbox slaves in Config. | Unsigned 32 | R | C | X | | 7 | Counter: TX frames | Unsigned32 | R | C | X | | 8 | Counter: RX frames | Unsigned32 | R | C | X | | 9 | Counter: Lost frames | Unsigned32 | R | C | X | | 10 | Counter: Cyclic frames | Unsigned32 | R | C | X | | 11 | Counter: Cyclic datagrams | Unsigned32 | R | C | X | | 12 | Counter: Acyclic frames | Unsigned32 | R | C | X | | 13 | Counter: Acyclic datagrams | Unsigned32 | R | C | X | | 14 | Clear Counters by writing 1 to bit(s) Bit 0: Clear all Counters Bit 1: Clear Tx Frame Counter (Idx 7) Bit 2: Clear Rx Frame Counter (Idx 8) Bit 3: Clear Lost Frame Counter (Idx 9) Bit 4: Clear Cyclic Frame Counter (Idx 10) Bit 5: Clear Cyclic Datagram Counter (Idx 11) Bit 6: Clear Acyclic Frame Counter (Idx 12) Bit 7: Clear Acyclic DataGram Counter (Idx 13) Bit 7-31: Reserved | Unsigned32 | RW | C | X | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2002 { EC_T_WORD wSubIndex0; EC_T_WORD wReserved; EC_T_DWORD dwCRC32ConfigCheckSum; EC_T_DWORD dwNumSlavesFound; EC_T_DWORD dwNumDCSlavesFound; EC_T_DWORD dwNumCfgSlaves; EC_T_DWORD dwNumMbxSlaves; EC_T_DWORD dwTXFrames; EC_T_DWORD dwRXFrames; EC_T_DWORD dwLostFrames; EC_T_DWORD dwCyclicFrames; EC_T_DWORD dwCyclicDatagrams; EC_T_DWORD dwAcyclicFrames; EC_T_DWORD dwAcyclicDatagrams; EC_T_DWORD dwClearCounters; } EC_PACKED(1) EC_T_OBJ2002; ``` ## Redundancy Diagnosis Object 0x2003 Object Type: RECORD, Manufacturer Specific Identity 0x52 | **Subindex** | **Description** | **Data Type** | **Access** | **M/O/C** | **Available** | |----------------|-----------------------|-----------------|--------------|-------------|-----------------| | 0 | Number of Entries | Unsigned8 | R | C | X | | 1 | Red Enabled | Unsigned8 | R | C | X | | 2 | Main Line Slave Count | Unsigned16 | R | C | X | | 3 | Red Line Slave Count | Unsigned16 | R | C | X | | 4 | Line Break Detected | Unsigned8 | R | C | X | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2003 { EC_T_WORD wSubIndex0; EC_T_BYTE byRedEnabled; EC_T_WORD wNumOfMainSlaves; EC_T_WORD wNumOfRedSlaves; EC_T_BYTE byLineBreak; } EC_PACKED(1) EC_T_OBJ2003; ``` ## Notify Counter Object 0x2004 | **Subindex** | **Description** | **Data Type** | **Access** | **M/O/C** | **Available** | |----------------|-------------------|-------------------|--------------|-------------|-----------------| | 0 | Number of Entries | Unsigned8 | R | C | X | | 1 | Maximum Messages | Unsigned8 | R | C | X | | 2 | Message Count | Unsigned8 | R | C | X | | 3 | Flags | Unsigned8 | RW | C | X | | 4 … | Messages | OBJ2004_NOTIFYMSG | R | C | X | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2004 { EC_T_WORD wSubIndex0; EC_T_BYTE byMaxMessages; EC_T_BYTE byMessageCount; EC_T_BYTE byFlags; /* SubIndex 004 and following see EC_T_OBJ2004_NOTIFYMSG below */ } EC_PACKED(1) EC_T_OBJ2004; ``` ### Notify Counter Object 0x2004: Subindex 4-255 | **Byte-Offset** | **Description** | **Data Type** | |-------------------|--------------------|-----------------| | 0 | Notification Code | Unsigned32 | | 4 | Notification Count | Unsigned32 | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2004_NOTIFYMSG { EC_T_DWORD dwCode; EC_T_DWORD dwCount; } EC_PACKED(1) EC_T_OBJ2004_NOTIFYMSG; ``` ## MAC Address 0x2005 Object Type: RECORD, Manufacturer Specific Identity 0x41 | **Subindex** | **Description** | **Data Type** | **Access** | **M/O/C** | **Available** | |----------------|---------------------------|-----------------|--------------|-------------|-----------------| | 0 | Number of Entries | Unsigned8 | R | C | X | | 1 | Hardware | Unsigned48 | R | C | X | | 2 | Red Hardware | Unsigned48 | R | C | X | | 3 | Configuration Source | Unsigned48 | R | C | X | | 4 | Configuration Destination | Unsigned48 | R | C | X | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2005 { EC_T_WORD wSubIndex0; EC_T_BYTE abyHardware[6]; EC_T_BYTE abyRedHardware[6]; EC_T_BYTE abyCfgSource[6]; EC_T_BYTE abyCfgDestination[6]; } EC_PACKED(1) EC_T_OBJ2005; ``` ## Mailbox Statistics Object 0x2006 Object Type: RECORD, Manufacturer Specific Identity 0x54 | **Subindex** | **Description** | **Data Type** | **Access** | **M/O/C** | **Available** | |----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------------|-------------|-----------------| | 0 | Number of Entries | Unsigned8 | R | C | X | | 1 | AoE Total Read Transfer Count | Unsigned32 | R | C | X | | 2 | AoE Read Transfer Count Last Second | Unsigned32 | R | C | X | | 3 | AoE Total Bytes Read | Unsigned32 | R | C | X | | 4 | AoE Bytes Read Last Second | Unsigned32 | R | C | X | | 5 … 8 | AoE Write Statistics Total / Last Second | Unsigned32 | R | C | X | | 9 … 16 | CoE Read / Write Statistics Total / Last Second | Unsigned32 | R | C | X | | 17…24 | EoE | Unsigned32 | R | C | X | | 25…32 | FoE | Unsigned32 | R | C | X | | 33…40 | SoE | Unsigned32 | R | C | X | | 41…48 | VoE | Unsigned32 | R | C | X | | 49…56 | RawMbx | Unsigned32 | R | C | X | | 57…64 | Reserved | Unsigned32 | R | C | X | | 65 | Clear Counters by writing 1 to bit(s) Bit 0…63: Clear Counter at SubIndex n, with: Bit 0: n = 1, Bit 1: n = 2 …, Bit 63: n = 64 E.g. 0x0000000100: Clear CoE Total Read Transfer Count | Unsigned64 | RW | C | X | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2006 { EC_T_WORD wSubIndex0; EC_T_DWORD dwCnt[64]; EC_T_UINT64 qwClearCounters; } EC_PACKED(1) EC_T_OBJ2006; ``` ## Add History Diagnosis Message Command Object 0x2007 Object Type: RECORD, Manufacturer Specific Identity 0x58 | **Subindex** | **Description** | **Data Type** | **Access** | **M/O/C** | Available | |----------------|--------------------------------------------|-----------------|--------------|-------------|-------------| | 0 | Number of Entries | Unsigned8 | R/W | M | X | | 1 | Diagnosis code | Unsigned32 | W | M | X | | 2 | Message type | Unsigned8 | W | M | X | | 3 | Message text ID | Unsigned16 | W | M | X | | 4 | Length of the parameters data | Unsigned8 | W | M | X | | 5 | Parameters data according to Object 0x10F3 | … | W | M | X | Datatype for application access: ```c++ typedef struct _EC_T_OBJ2007_HISTORY_ADD_DIAGMSG { EC_T_WORD wSubIndex0; EC_T_DWORD dwDiagCode; EC_T_BYTE byType; EC_T_WORD wTextID; EC_T_BYTE byParmsLen; EC_T_BYTE abyParms[HISTORY_OBJECT_DIAGELE_SIZE]; } EC_PACKED(1) EC_T_OBJ2007_HISTORY_ADD_DIAGMSG; ``` ## Debug Register 0x2010 | **Attribute** | **Value** | |-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------| | Name | Debug Register | | Object Code | VAR | | Data Type | Unsigned64 | | Category | Customer | | Access | RW | | Value | Lower 32Bit: Log level, see EC_T_INIT_MASTER_PARMS.LogParms.dwLogLevel (semantics changed in V3.0, formerly dwStateChangeDebug) Upper 32Bit: reserved | ## MainDevice Init Parameters 0x2020 Object Type: RECORD, Manufacturer Specific Identity 0x42 | **Sub-index** | **Description** | **Data Type** | **Access** | **M/O/C** | Available | |-----------------|------------------------------------------------------------------------|-----------------|--------------|-------------|-------------| | 0 | Number of Entries | Unsigned8 | R | C | X | | 1 | dwVersion Application | Unsigned32 | R | C | X | | 2 | dwVersion Master | Unsigned32 | R | C | | | 3 | EC_T_INIT_MASTER_PARMS.dwMaxSlavesProcessedPerCycle | Unsigned32 | R | C | X | | 4 | EC_T_INIT_MASTER_PARMS.dwEcatCmdTimeout [ms] | Unsigned32 | R | C | X | | 5 | EC_T_INIT_MASTER_PARMS.dwEcatCmdMaxRetries | Unsigned32 | R | C | X | | 6 | Bus cycle time [us] (EC_T_INIT_MASTER_PARMS.dwBusCycleTimeNsec / 1000) | Unsigned32 | R | C | X | | 7 | Obsolete, always 0 (formerly EoE timeout [ms]) | Unsigned32 | R | C | X | | 8 | Obsolete, always 0 (formerly FoE busy timeout [ms]) | Unsigned32 | R | C | X | | 9 | EC_T_INIT_MASTER_PARMS.dwMaxAcycFramesQueued | Unsigned32 | R | C | X | | 10 | Maximum acyclic commands per frame | Unsigned32 | R | C | X | | 11 | EC_T_INIT_MASTER_PARMS.dwMaxBusSlaves | Unsigned32 | R | C | X | | 12 | Reserved | Unsigned32 | R | C | X | | 13 | EC_T_INIT_MASTER_PARMS.LogParms.dwLogLevel (semantics changed in V3.0) | Unsigned32 | R | C | X | | 14 | Link layer name, see EC_T_LINK_PARMS.szDriverIdent | VisibleString | R | C | X | | 15 | Link layer polling mode active | Bool32 | R | C | X | | 16 | Link layer allocate send frame active | Bool32 | R | C | X | Datatype for application access: ```c++ #define EC_OD_DRIVER_IDENT_SIZE 40 /* maximum length of link layer name */ typedef struct _EC_T_OBJ2020 { EC_T_WORD wSubIndex0; EC_T_DWORD dwApplicationVersion; EC_T_DWORD dwMasterVersion; EC_T_DWORD dwMaxSlavesProcessedPerCycle; EC_T_DWORD dwEcatCmdTimeout; EC_T_DWORD dwEcatCmdMaxRetries; EC_T_DWORD dwBusCycleTimeUsec; EC_T_DWORD dwEoeTimeout; EC_T_DWORD dwFoeBusyTimeout; EC_T_DWORD dwMaxAcycFramesQueued; EC_T_DWORD dwMaxAcycCmdsPerFrame; EC_T_DWORD dwMaxBusSlave; EC_T_DWORD dwReserved2; EC_T_DWORD dwStateChangeDebug; EC_T_CHAR szDriverIdent[EC_OD_DRIVER_IDENT_SIZE]; EC_T_BOOL bPollingModeActive; EC_T_BOOL bAllocSendFrameActive; } EC_PACKED(1) EC_T_OBJ2020; ```