![]() |
ECAT_Slave_in_ПЧ2П_c402
0.8
Реализация EtherCAT Slave для CM TMS320F28388D
|
Макросы | |
| #define | OBJGETNEXTSTR(p) ( (OBJCONST CHAR OBJMEM * )( &((p)[OBJSTRLEN( (OBJCONST CHAR OBJMEM *) (p) ) + 1]) ) ) |
| Macro to get next name within the objetc name string. Подробнее... | |
| #define | LO_BYTE 0 |
| LowByte within an WORD. Подробнее... | |
| #define | HI_BYTE 1 |
| HighByte within an WORD. Подробнее... | |
| #define | LOLO_BYTE 0 |
| LowLowByte within an DWORD. Подробнее... | |
| #define | LOHI_BYTE 1 |
| LowHighByte within an DWORD. Подробнее... | |
| #define | HILO_BYTE 2 |
| HighLowByte within an DWORD. Подробнее... | |
| #define | HIHI_BYTE 3 |
| HighHighByte within an DWORD. Подробнее... | |
| #define | LO_WORD 0 |
| LowWord within an DWORD. Подробнее... | |
| #define | HI_WORD 1 |
| HighWord within an DWORD. Подробнее... | |
| #define | SWAPWORD(x) (x) |
| Macro to swap a WORD. Подробнее... | |
| #define | SWAPDWORD(x) (x) |
| Macro to swap a DWORD. Подробнее... | |
| #define | LOBYTE(x) ((x)&0xFF) |
| LowByte mask. Подробнее... | |
| #define | HIBYTE(x) (((x)&0xFF00)>>8) |
| HighwByte mask. Подробнее... | |
| #define | LOLOBYTE(x) ((x)&0xFF) |
| LowLowByte mask. Подробнее... | |
| #define | LOHIBYTE(x) (((x)&0xFF00)>>8) |
| LowHighByte mask. Подробнее... | |
| #define | HILOBYTE(x) (((x)&0xFF0000)>>16) |
| HighLowByte mask. Подробнее... | |
| #define | HIHIBYTE(x) (((x)&0xFF000000)>>24) |
| HighHighByte mask. Подробнее... | |
| #define | LOWORD(x) ((x)&0xFFFF) |
| LowWord mask. Подробнее... | |
| #define | HIWORD(x) (((x)&0xFFFF0000)>>16) |
| HighByte mask. Подробнее... | |
| #define | BIT2BYTE(x) (((x)+7)>>3) |
| Macro to convert Bit size to Byte size (round up) Подробнее... | |
| #define | BYTE2BIT(x) ((x)<<3) |
| Macro to convert Byte size to Bit size. Подробнее... | |
| #define | BIT2WORD(x) (((x)+15)>>4) |
| Macro to convert Bit size to Word size (round up) Подробнее... | |
| #define | BYTE2WORD(x) (((x)+1)>>1) |
| Macro to convert Bytes size to Word size (round up) Подробнее... | |
| #define | ROUNDUPBYTE2WORD(x) ((((x)+1)>>1)<<1) |
| Round up Byte size to even number of Words. Подробнее... | |
| #define | STATE_INIT ((UINT8) 0x01) |
| State INIT. Подробнее... | |
| #define | STATE_PREOP ((UINT8) 0x02) |
| State PreOP. Подробнее... | |
| #define | STATE_BOOT ((UINT8) 0x03) |
| State BOOT. Подробнее... | |
| #define | STATE_SAFEOP ((UINT8) 0x04) |
| State SafeOP. Подробнее... | |
| #define | STATE_OP ((UINT8) 0x08) |
| State OP. Подробнее... | |
| #define | STATE_MASK ((UINT8) 0x0F) |
| State mask. Подробнее... | |
| #define | STATE_CHANGE ((UINT8) 0x10) |
| State change (Error indication/acknowledge) mask and value. Подробнее... | |
| #define | STATE_DEVID ((UINT8) 0x20) |
| Request/response Explicit device ID. Подробнее... | |
| #define | STATE_VALID(x) ((((x) & STATE_MASK) == STATE_INIT) || (((x) & STATE_MASK) == STATE_PREOP) || (((x) & STATE_MASK) == STATE_SAFEOP) || (((x) & STATE_MASK) == STATE_OP)) |
| Check if one of the mandatory supported state values are set. Подробнее... | |
| #define | BOOT_2_INIT ((UINT8)((STATE_BOOT) << 4) | (STATE_INIT)) |
| State transition BOOT to INIT. Подробнее... | |
| #define | BOOT_2_PREOP ((UINT8)((STATE_BOOT) << 4) | (STATE_PREOP)) |
| State transition BOOT to INIT. Подробнее... | |
| #define | BOOT_2_SAFEOP ((UINT8)((STATE_BOOT) << 4) | (STATE_SAFEOP)) |
| State transition BOOT to INIT. Подробнее... | |
| #define | BOOT_2_OP ((UINT8)((STATE_BOOT) << 4) | (STATE_OP)) |
| State transition BOOT to INIT. Подробнее... | |
| #define | INIT_2_BOOT ((UINT8)((STATE_INIT) << 4) | (STATE_BOOT)) |
| State transition INIT to BOOT. Подробнее... | |
| #define | PREOP_2_BOOT ((UINT8)((STATE_PREOP) << 4) | (STATE_BOOT)) |
| State transition PREOP to BOOT. Подробнее... | |
| #define | SAFEOP_2_BOOT ((UINT8)((STATE_SAFEOP) << 4) | (STATE_BOOT)) |
| State transition SAFEOP to BOOT. Подробнее... | |
| #define | OP_2_BOOT ((UINT8)((STATE_OP) << 4) | (STATE_BOOT)) |
| State transition OP to BOOT. Подробнее... | |
| #define | INIT_2_INIT ((UINT8)((STATE_INIT) << 4) | (STATE_INIT)) |
| State transition INIT to INIT. Подробнее... | |
| #define | INIT_2_PREOP ((UINT8)((STATE_INIT) << 4) | (STATE_PREOP)) |
| State transition INIT to PREOP. Подробнее... | |
| #define | INIT_2_SAFEOP ((UINT8)((STATE_INIT) << 4) | (STATE_SAFEOP)) |
| State transition INIT to SAFEOP. Подробнее... | |
| #define | INIT_2_OP ((UINT8)((STATE_INIT) << 4) | (STATE_OP)) |
| State transition INIT to OP. Подробнее... | |
| #define | PREOP_2_INIT ((UINT8)((STATE_PREOP) << 4) | (STATE_INIT)) |
| State transition PREOP to INIT. Подробнее... | |
| #define | PREOP_2_PREOP ((UINT8)((STATE_PREOP) << 4) | (STATE_PREOP)) |
| State transition PREOP to PREOP. Подробнее... | |
| #define | PREOP_2_SAFEOP ((UINT8)((STATE_PREOP) << 4) | (STATE_SAFEOP)) |
| State transition PREOP to SAFEOP. Подробнее... | |
| #define | PREOP_2_OP ((UINT8)((STATE_PREOP) << 4) | (STATE_OP)) |
| State transition PREOP to OP. Подробнее... | |
| #define | SAFEOP_2_INIT ((UINT8)((STATE_SAFEOP) << 4) | (STATE_INIT)) |
| State transition SAFEOP to INIT. Подробнее... | |
| #define | SAFEOP_2_PREOP ((UINT8)((STATE_SAFEOP) << 4) | (STATE_PREOP)) |
| State transition SAFEOP to PREOP. Подробнее... | |
| #define | SAFEOP_2_SAFEOP ((UINT8)((STATE_SAFEOP) << 4) | (STATE_SAFEOP)) |
| State transition SAFEOP to SAFEOP. Подробнее... | |
| #define | SAFEOP_2_OP ((UINT8)((STATE_SAFEOP) << 4) |( STATE_OP)) |
| State transition SAFEOP to OP. Подробнее... | |
| #define | OP_2_INIT ((UINT8)((STATE_OP) << 4) | (STATE_INIT)) |
| State transition OP to INIT. Подробнее... | |
| #define | OP_2_PREOP ((UINT8)((STATE_OP) << 4) | (STATE_PREOP)) |
| State transition OP to PREOP. Подробнее... | |
| #define | OP_2_SAFEOP ((UINT8)((STATE_OP) << 4) | (STATE_SAFEOP)) |
| State transition OP to SAFEOP. Подробнее... | |
| #define | OP_2_OP ((UINT8)((STATE_OP) << 4) | (STATE_OP)) |
| State transition OP to OP. Подробнее... | |
| #define | SYNCMANCHSIZE 0x00 |
| Emergency and Diagnosis code for an invalid SyncManager size. Подробнее... | |
| #define | SYNCMANCHADDRESS 0x01 |
| Emergency and Diagnosis code for an invalid SyncManager address. Подробнее... | |
| #define | SYNCMANCHSETTINGS 0x02 |
| Emergency and Diagnosis code for an invalid SyncManager settings. Подробнее... | |
| #define | ERROR_SYNCMANCH(code, channel) ((code)+((channel)<<2)) |
| Macro to add SyncManager channel. Подробнее... | |
| #define | ERROR_SYNCMANCHADDRESS(channel) ((SYNCMANCHADDRESS)+((channel)<<2)) |
| Macro to add SyncManager channel. Подробнее... | |
| #define | ERROR_SYNCMANCHSIZE(channel) ((SYNCMANCHSIZE)+((channel)<<2)) |
| Macro to add SyncManager channel. Подробнее... | |
| #define | ERROR_SYNCMANCHSETTINGS(channel) ((SYNCMANCHSETTINGS)+((channel)<<2)) |
| Macro to add SyncManager channel. Подробнее... | |
| #define | ERROR_SYNCTYPES 0x80 |
| Emergency and Diagnosis code for an invalid Sync types. Подробнее... | |
| #define | ERROR_DCSYNCCONTROL 0x81 |
| Emergency and Diagnosis code for an invalid DC Sync control. Подробнее... | |
| #define | ERROR_DCSYNC0CYCLETIME 0x82 |
| Emergency and Diagnosis code for an invalid Sync0 cycle time. Подробнее... | |
| #define | ERROR_DCSYNC1CYCLETIME 0x83 |
| Emergency and Diagnosis code for an invalid Sync1 cycle time. Подробнее... | |
| #define | ERROR_DCCYCLEPARAMETER 0x84 |
| Emergency and Diagnosis code for an invalid Cycle parameter. Подробнее... | |
| #define | ERROR_DCLATCHCONTROL 0x85 |
| Emergency and Diagnosis code for an invalid Latch control. Подробнее... | |
| #define | ERROR_INVALIDSTATE 0xF0 |
| Emergency and Diagnosis code for an invalid State. Подробнее... | |
| #define | ERROR_NOMEMORY 0xF1 |
| Emergency and Diagnosis code for no memory. Подробнее... | |
| #define | ERROR_OBJECTDICTIONARY 0xF2 |
| Emergency and Diagnosis code for generic object dictionary error. Подробнее... | |
| #define | ERROR_NOSYNCMANACCESS 0xF3 |
| Emergency and Diagnosis code for no SyncManager access. Подробнее... | |
| #define | ERROR_NOOFRXPDOS 0xF4 |
| Emergency and Diagnosis code for no RxPDOs. Подробнее... | |
| #define | ERROR_NOOFTXPDOS 0xF5 |
| Emergency and Diagnosis code for no TxPDOs. Подробнее... | |
| #define | ERROR_STATECHANGE 0xF6 |
| Emergency and Diagnosis code state change error. Подробнее... | |
| #define | NOERROR_NOSTATECHANGE 0xFE |
| Indicates no state change. Подробнее... | |
| #define | NOERROR_INWORK 0xFF |
| Indication for no error but operation is pending. Подробнее... | |
| #define | EMCY_SM_ERRORCODE 0xA000 |
| Emergency and Diagnosis code for an SyncManager error. Подробнее... | |
| #define | EMCY_SM_DEVICESPECIFIC 0xFF00 |
| Emergency and Diagnosis code for a device specific error. Подробнее... | |
| #define | ALSTATUSCODE_NOERROR 0x0000 |
| No error. Подробнее... | |
| #define | ALSTATUSCODE_UNSPECIFIEDERROR 0x0001 |
| Unspecified error. Подробнее... | |
| #define | ALSTATUSCODE_NOMEMORY 0x0002 |
| No Memory. Подробнее... | |
| #define | ALSTATUSCODE_INVALID_REVISION 0x0004 |
| Output/Input mapping is not valid for this hardware or software revision (0x1018:03) Подробнее... | |
| #define | ALSTATUSCODE_FW_SII_NOT_MATCH 0x0006 |
| Firmware and EEPROM do not match. Slave needs BOOT-INIT transition. Подробнее... | |
| #define | ALSTATUSCODE_FW_UPDATE_FAILED 0x0007 |
| Firmware update not successful. Old firmware still running. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDALCONTROL 0x0011 |
| Invalid requested state change. Подробнее... | |
| #define | ALSTATUSCODE_UNKNOWNALCONTROL 0x0012 |
| Unknown requested state. Подробнее... | |
| #define | ALSTATUSCODE_BOOTNOTSUPP 0x0013 |
| Bootstrap not supported. Подробнее... | |
| #define | ALSTATUSCODE_NOVALIDFIRMWARE 0x0014 |
| No valid firmware. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDMBXCFGINBOOT 0x0015 |
| Invalid mailbox configuration (BOOT state) Подробнее... | |
| #define | ALSTATUSCODE_INVALIDMBXCFGINPREOP 0x0016 |
| Invalid mailbox configuration (PreOP state) Подробнее... | |
| #define | ALSTATUSCODE_INVALIDSMCFG 0x0017 |
| Invalid sync manager configuration. Подробнее... | |
| #define | ALSTATUSCODE_NOVALIDINPUTS 0x0018 |
| No valid inputs available. Подробнее... | |
| #define | ALSTATUSCODE_NOVALIDOUTPUTS 0x0019 |
| No valid outputs. Подробнее... | |
| #define | ALSTATUSCODE_SYNCERROR 0x001A |
| Synchronization error. Подробнее... | |
| #define | ALSTATUSCODE_SMWATCHDOG 0x001B |
| Sync manager watchdog. Подробнее... | |
| #define | ALSTATUSCODE_SYNCTYPESNOTCOMPATIBLE 0x001C |
| Invalid Sync Manager Types. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDSMOUTCFG 0x001D |
| Invalid Output Configuration. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDSMINCFG 0x001E |
| Invalid Input Configuration. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDWDCFG 0x001F |
| Invalid Watchdog Configuration. Подробнее... | |
| #define | ALSTATUSCODE_WAITFORCOLDSTART 0x0020 |
| Slave needs cold start. Подробнее... | |
| #define | ALSTATUSCODE_WAITFORINIT 0x0021 |
| Slave needs INIT. Подробнее... | |
| #define | ALSTATUSCODE_WAITFORPREOP 0x0022 |
| Slave needs PREOP. Подробнее... | |
| #define | ALSTATUSCODE_WAITFORSAFEOP 0x0023 |
| Slave needs SAFEOP. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDINPUTMAPPING 0x0024 |
| Invalid Input Mapping. Подробнее... | |
| #define | ALSTATUSCODE_INVALIDOUTPUTMAPPING 0x0025 |
| Invalid Output Mapping. Подробнее... | |
| #define | ALSTATUSCODE_INCONSISTENTSETTINGS 0x0026 |
| Inconsistent Settings. Подробнее... | |
| #define | ALSTATUSCODE_FREERUNNOTSUPPORTED 0x0027 |
| FreeRun not supported. Подробнее... | |
| #define | ALSTATUSCODE_SYNCHRONNOTSUPPORTED 0x0028 |
| SyncMode not supported. Подробнее... | |
| #define | ALSTATUSCODE_FREERUNNEEDS3BUFFERMODE 0x0029 |
| FreeRun needs 3Buffer Mode. Подробнее... | |
| #define | ALSTATUSCODE_BACKGROUNDWATCHDOG 0x002A |
| Background Watchdog. Подробнее... | |
| #define | ALSTATUSCODE_NOVALIDINPUTSANDOUTPUTS 0x002B |
| No Valid Inputs and Outputs. Подробнее... | |
| #define | ALSTATUSCODE_FATALSYNCERROR 0x002C |
| Fatal Sync Error. Подробнее... | |
| #define | ALSTATUSCODE_NOSYNCERROR 0x002D |
| No Sync Error. Подробнее... | |
| #define | ALSTATUSCODE_CYCLETIMETOOSMALL 0x002E |
| EtherCAT cycle time smaller Minimum Cycle Time supported by slave. Подробнее... | |
| #define | ALSTATUSCODE_DCINVALIDSYNCCFG 0x0030 |
| Invalid DC SYNCH Configuration. Подробнее... | |
| #define | ALSTATUSCODE_DCINVALIDLATCHCFG 0x0031 |
| Invalid DC Latch Configuration. Подробнее... | |
| #define | ALSTATUSCODE_DCPLLSYNCERROR 0x0032 |
| PLL Error. Подробнее... | |
| #define | ALSTATUSCODE_DCSYNCIOERROR 0x0033 |
| DC Sync IO Error. Подробнее... | |
| #define | ALSTATUSCODE_DCSYNCMISSEDERROR 0x0034 |
| DC Sync Timeout Error. Подробнее... | |
| #define | ALSTATUSCODE_DCINVALIDSYNCCYCLETIME 0x0035 |
| DC Invalid Sync Cycle Time. Подробнее... | |
| #define | ALSTATUSCODE_DCSYNC0CYCLETIME 0x0036 |
| DC Sync0 Cycle Time. Подробнее... | |
| #define | ALSTATUSCODE_DCSYNC1CYCLETIME 0x0037 |
| DC Sync1 Cycle Time. Подробнее... | |
| #define | ALSTATUSCODE_MBX_AOE 0x0041 |
| MBX_AOE. Подробнее... | |
| #define | ALSTATUSCODE_MBX_EOE 0x0042 |
| MBX_EOE. Подробнее... | |
| #define | ALSTATUSCODE_MBX_COE 0x0043 |
| MBX_COE. Подробнее... | |
| #define | ALSTATUSCODE_MBX_FOE 0x0044 |
| MBX_FOE. Подробнее... | |
| #define | ALSTATUSCODE_MBX_SOE 0x0045 |
| MBX_SOE. Подробнее... | |
| #define | ALSTATUSCODE_MBX_VOE 0x004F |
| MBX_VOE. Подробнее... | |
| #define | ALSTATUSCODE_EE_NOACCESS 0x0050 |
| EEPROM no access. Подробнее... | |
| #define | ALSTATUSCODE_EE_ERROR 0x0051 |
| EEPROM Error. Подробнее... | |
| #define | ALSTATUSCODE_EXT_HARDWARE_NOT_READY 0x0052 |
| External hardware not ready. This AL Status Code should be used if the EtherCAT-Slave refused the state transition due to an external connection to another device or signal is missing. Подробнее... | |
| #define | ALSTATUSCODE_DEVICE_IDENT_VALUE_UPDATED 0x0061 |
| In legacy identification mode (dip switch mapped to register 0x12) this error is returned if the EEPROM ID value does not match to dipswitch value. Подробнее... | |
| #define | ALSTATUSCODE_MODULE_ID_LIST_NOT_MATCH 0x0070 |
| Detected Module Ident List (0xF030) and Configured Module Ident List (0xF050) does not match. Подробнее... | |
| #define | ALSTATUSCODE_SUPPLY_VOLTAGE_TOO_LOW 0x0080 |
| The slave supply voltage is too low. Подробнее... | |
| #define | ALSTATUSCODE_SUPPLY_VOLTAGE_TOO_HIGH 0x0081 |
| The slave supply voltage is too high. Подробнее... | |
| #define | ALSTATUSCODE_TEMPERATURE_TOO_LOW 0x0082 |
| The slave temperature is too low. Подробнее... | |
| #define | ALSTATUSCODE_TEMPERATURE_TOO_HIGH 0x0083 |
| The slave temperature is too high. Подробнее... | |
| #define | SYNCTYPE_FREERUN 0x0000 |
| Sync type FreeRun. Подробнее... | |
| #define | SYNCTYPE_SM_SYNCHRON 0x0001 |
| SyncManager synchron (synchron to the corresponding SM, 0x1C32.1 -> SM2 ; 0x1C33.1 -> SM3) Подробнее... | |
| #define | SYNCTYPE_SM2_SYNCHRON 0x0022 |
| SyncManager2 synchron (only used for 0x1C33.1) Подробнее... | |
| #define | SYNCTYPE_DCSYNC0 0x0002 |
| Sync type Sync0 synchron. Подробнее... | |
| #define | SYNCTYPE_DCSYNC1 0x0003 |
| Sync type Sync1 synchron. Подробнее... | |
| #define | AL_CONTROL_EVENT ((UINT16) 0x01) |
| AL Control event. Подробнее... | |
| #define | SYNC0_EVENT ((UINT16) 0x04) |
| Sync0 event. Подробнее... | |
| #define | SYNC1_EVENT ((UINT16) 0x08) |
| Sync1 event. Подробнее... | |
| #define | SM_CHANGE_EVENT ((UINT16) 0x10) |
| SyncManager changed event. Подробнее... | |
| #define | EEPROM_CMD_PENDING ((UINT16) 0x20) |
| EEPROM command pending. Подробнее... | |
| #define | MAILBOX_WRITE_EVENT ((UINT16) 0x0100) |
| MBoxOut write event. Подробнее... | |
| #define | MAILBOX_READ_EVENT ((UINT16) 0x0200) |
| MBoxIn read event. Подробнее... | |
| #define | PROCESS_OUTPUT_EVENT ((UINT16) 0x0400) |
| Output process data write event. Подробнее... | |
| #define | PROCESS_INPUT_EVENT ((UINT16) 0x0800) |
| Input process data read event. Подробнее... | |
| #define | MAILBOX_WRITE 0 |
| SyncManager ID for MBoxOut (master to slave) Подробнее... | |
| #define | MAILBOX_READ 1 |
| SyncManager ID for MBoxIn (slave to master) Подробнее... | |
| #define | PROCESS_DATA_OUT 2 |
| SyncManager ID for output process data (master to slave) Подробнее... | |
| #define | PROCESS_DATA_IN 3 |
| SyncManager ID for input process data (slave to master) Подробнее... | |
| #define | LED_OFF 0x00 |
| LED off. Подробнее... | |
| #define | LED_FLICKERING 0x60 |
| LED flickering. Подробнее... | |
| #define | LED_BLINKING 0x40 |
| LED blinking. Подробнее... | |
| #define | LED_SINGLEFLASH 0x41 |
| LED single flash. Подробнее... | |
| #define | LED_DOUBLEFLASH 0x42 |
| LED double flash. Подробнее... | |
| #define | LED_INVERT_DOUBLEFLASH 0xC2 |
| LED invert double flash. Подробнее... | |
| #define | LED_ON 0x01 |
| LED on. Подробнее... | |
| #define | MEMORY_START_ADDRESS 0x1000 |
| ESC DPRAM start address. Подробнее... | |
| #define | DC_SYNC_ACTIVE ESC_DC_SYNC0_ACTIVE_MASK |
| Expected activated Sync signals by the master. Подробнее... | |
| #define | DC_EVENT_MASK PROCESS_OUTPUT_EVENT |
| AL Event mask (value of register 0x204) in case of DC synchronisation. Подробнее... | |
| #define | PROTO extern |
| #define | MAX_SM_EVENT_MISSED 4 |
| threshold of max missed counter value (0x1C32.11 / 0x1C33.11) Подробнее... | |
Функции | |
| void | EnableSyncManChannel (UINT8 channel) |
| This function enables a Sync Manager channel. Подробнее... | |
| void | DisableSyncManChannel (UINT8 channel) |
| This function disables a Sync Manager channel. Подробнее... | |
| TSYNCMAN ESCMEM * | GetSyncMan (UINT8 channel) |
| This function is called to read the SYNC Manager channel descriptions of the process data SYNC Managers. Подробнее... | |
| void | SetALStatus (UINT8 alStatus, UINT16 alStatusCode) |
| The function changes the state of the EtherCAT ASIC to the requested. Подробнее... | |
| void | AL_ControlInd (UINT8 alControl, UINT16 alStatusCode) |
| This function handles the EtherCAT State Machine. It is called in case of an AL Control event (Bit 0 of AL-Event (Reg 0x220), when the Master has written the AL Control Register (from ECAT_Main), alControl contains the content of the AL Control (Reg 0x120) in case of a SM-Change event (Bit 4 of AL-Event (Reg 0x220)), when an Activate SYNCM y register is written by the master (from ECAT_Main), alControl contains the actual state (Bit 0-3 of AL Status (Reg 0x130)) in case of a locally expired watchdog (from ECAT_Main), alControl contains the requested new state (SAFE_OP) in case of an application specific event to change the EtherCAT state (from application), alControl contains the requested new state (INIT, PRE_OP or SAFE_OP) Подробнее... | |
| void | DC_CheckWatchdog (void) |
| This function checks the current Sync state and set the local flags The analyse of the local flags is handled in "CheckIfEcatError". Подробнее... | |
| void | CheckIfEcatError (void) |
| Checks communication and synchronisation variables and update AL status / AL status code if an error has occurred. Подробнее... | |
| void | ECAT_Init (void) |
| This function initialize the EtherCAT Slave Interface. Подробнее... | |
| void | ECAT_Main (void) |
| This function has to be called cyclically. Подробнее... | |
Переменные | |
| PROTO BOOL | bEcatOutputUpdateRunning |
| Indicates the OP state, will be set in StartOutputHandler and reset in StopOutputHandler. Подробнее... | |
| PROTO BOOL | bEcatInputUpdateRunning |
| Indicates the SAFEOP or OP state, will be set in StartInputHandler and reset in Stop InputHandler. Подробнее... | |
| PROTO BOOL | bEcatFirstOutputsReceived |
| Indicates if outputs were received (SM2-event) or inputs were read (SM3-event, if the output size is 0), has to be set by the application and reset in StopOutputHandler. Подробнее... | |
| PROTO BOOL | bWdTrigger |
| Indicates that the SM2 WD trigger bit (0x814 bit6) is set. Подробнее... | |
| PROTO BOOL | bDcSyncActive |
| Indicates that the Distributed Clocks synchronization is active,. Подробнее... | |
| PROTO INT16 | EsmTimeoutCounter |
| Counter used to detect an ESM timeout. -1 indicates a deactivated counter and 0 is expired. Подробнее... | |
| PROTO BOOL | bDcRunning |
| Indicates if Sync0 events are received. Подробнее... | |
| PROTO UINT16 | u16SmSync0Counter |
| PROTO UINT16 | u16SmSync0Value |
| PROTO BOOL | bSmSyncSequenceValid |
| Set to true if SM/Sync0 sequence is valid. Подробнее... | |
| PROTO INT16 | i16WaitForPllRunningTimeout |
| The time bPllRunnig shall be true while state change from SafeOp to Op. Подробнее... | |
| PROTO INT16 | i16WaitForPllRunningCnt |
| Incremented with every valid Sync-SyncManger cycle. Подробнее... | |
| PROTO UINT16 | Sync0WdCounter |
| Sync0 watchdog counter. Подробнее... | |
| PROTO UINT16 | Sync0WdValue |
| Sync0 watchdog value. Подробнее... | |
| PROTO UINT16 | Sync1WdCounter |
| Sync1 watchdog counter. Подробнее... | |
| PROTO UINT16 | Sync1WdValue |
| Sync1 watchdog value. Подробнее... | |
| PROTO UINT16 | LatchInputSync0Value |
| Sync0 event on which the inputs shall be latched and copied to the ESC buffer. If the inputs shall be latched base don Sync1 the value is set to 0. Подробнее... | |
| PROTO UINT16 | LatchInputSync0Counter |
| Sync0 counter used to get the Sync0 event to latch the Inputs. Подробнее... | |
| PROTO BOOL | b32BitDc |
| PROTO BOOL | bEscIntEnabled |
| Indicates that the ESC interrupt is enabled (SM2/3 or SYNC0/1-event), will be set in StartInputHandler and reset in StopInputHandler. Подробнее... | |
| PROTO BOOL | b3BufferMode |
| Indicates that inputs and outputs are running in 3-Buffer-Mode. Подробнее... | |
| PROTO UINT16 | u16LocalErrorCode |
| Reason for local error. Подробнее... | |
| PROTO UINT8 | u8LocalErrorState |
| State of the current local error (lower state could be set by the master) Подробнее... | |
| PROTO BOOL | bApplEsmPending |
| Indicates if the local application ESM function need to be called from Al_ConntrolRes (is true if NOERR_INWORK is returned by generic ESM function) Подробнее... | |
| PROTO BOOL | bEcatWaitForAlControlRes |
| Contains the information that the state machine waits for an acknowledge for the last AL_ControlInd from the application/generic stack. Подробнее... | |
| PROTO UINT16 | nEcatStateTrans |
| Current state transition. Подробнее... | |
| PROTO UINT8 | u8EcatErrorLed |
| Current value of the error LED. Подробнее... | |
| PROTO UINT8 | u8EcatRunLed |
| Current value of the run LED. Подробнее... | |
| PROTO UINT16 | nPdInputSize |
| Contains the input size (SM3 size)/SM2 if no outputs are supported, has to be written by the application. Подробнее... | |
| PROTO UINT16 | nPdOutputSize |
| Contains the output size (SM2 size), has to be written by the application. Подробнее... | |
| PROTO UINT8 | nMaxSyncMan |
| Contains the maximum number of Sync Manager channels, will be initialized in ECAT_Main. Подробнее... | |
| PROTO UINT16 | nMaxEscAddress |
| Max supported address by the ESC (register(0x1000) + size of the supported DPRAM in Byte) Подробнее... | |
| PROTO UINT8 | nAlStatus |
| Contains the actual AL Status, will be written in AL_ControlInd. Подробнее... | |
| PROTO UINT16 | EcatWdValue |
| Contains the value of the watchdog in ms, will be written in StartInputHandler. In case that the ESC watchdog feature is used this variable just indicates if the watchdog is enabled or disabled. Подробнее... | |
| PROTO UINT16 | nEscAddrOutputData |
| Contains the SM address for the output process data. Подробнее... | |
| PROTO UINT16 | nEscAddrInputData |
| Contains the SM address for the input process data. Подробнее... | |
Changes to version V5.12:
V5.13 EMCY1: update emergency diagcodes for invalid sm configuration
V5.13 ESM1: local error handling update, ECAT_StateChange triggers only transitions from Op->Any or reject/accept a pending transition
Changes to version V5.11:
V5.12 COE4: add timestamp object (0x10F8) and update diagnosis handling
V5.12 ECAT6: remove mailbox SyncManager if no mailbox is supported (SM0 Output, SM1 Input)
Changes to version V5.10:
V5.11 ECAT10: change PROTO handling to prevent compiler errors
V5.11 ECAT4: enhance SM/Sync monitoring for input/output only slaves
V5.11 ECAT9: add new AL Status Codes (ALSTATUSCODE_FW_SII_NOT_MATCH/0x0006, ALSTATUSCODE_FW_UPDATE_FAILED / 0x0007)
V5.11 ESM7: "add Sync define for 0x22 (""SYNCTYPE_SM2_SYNCHRON""), support value 0x22 for 0x1C33.1 (SM2 sync)"
V5.11 HW1: "move hardware independent functions ""HW_DisableSyncManChannel()"", ""HW_EnableSyncManChannel()"", ""HW_GetSyncMan()"", ""HW_ResetALEventMask()"", ""HW_SetALEventMask()"" to ecatalv.c"
Changes to version V5.01:
V5.10 COE1: Define one entry description for all 0x1C3x objects and change data type of SI11,12,13 to UINT16 (according ETG.1020)
V5.10 ECAT12: Add new AL Status Codes (0x2E,0x52,0x70)
V5.10 ECAT13: Update Synchronisation handling (FreeRun,SM Sync, Sync0, Sync1)
Compare DC UINT configuration (by ESC Config data) vs. DC activation register settings
Update 0x1C3x entries
Changes to version - :
V5.01 : Start file change log
См. определение в файле ecatslv.h