![]() |
ECAT_Slave_in_ПЧ2П_c402
0.8
Реализация EtherCAT Slave для CM TMS320F28388D
|
Implementation This file contains an example for CoE services and the CoE object dictionary. Подробнее...
Макросы | |
| #define | _COEAPPL_ 1 |
| #define | _OBJD_ |
Функции | |
| UINT8 | Read0x10F8 (UINT16 index, UINT8 subindex, UINT32 dataSize, UINT16 MBXMEM *pData, UINT8 bCompleteAccess) |
| This function reads the object 0x10F8. Подробнее... | |
| void | COE_SyncTimeStamp (void) |
| This function updates the local time stamp object (0x10F8) and has to be called at least every 4.2sec to detect an 32Bit DC unit overrun. Called from the Timer handler. Подробнее... | |
| OBJCONST TOBJECT OBJMEM * | COE_GetObjectDictionary (void) |
| returns the pointer to the object dictionary Подробнее... | |
| void | COE_UpdateSyncErrorStatus (void) |
| Update the Sync Error Indication. Подробнее... | |
| void | COE_ObjInit (void) |
| This function initialize the several objects. Подробнее... | |
| UINT16 | COE_AddObjectToDic (TOBJECT OBJMEM *pNewObjEntry) |
| This function adds an object to the object dictionary. Подробнее... | |
| void | COE_RemoveDicEntry (UINT16 index) |
| This function removes an object to the object dictionary. Подробнее... | |
| void | COE_ClearObjDictionary (void) |
| This function clear the object dictionary. Подробнее... | |
| UINT16 | AddObjectsToObjDictionary (TOBJECT OBJMEM *pObjEntry) |
| UINT16 | COE_ObjDictionaryInit (void) |
| This function initialize the object dictionary. Подробнее... | |
| void | COE_Main (void) |
| is called for background calculations which should not influence the ECAT_Application in synchronous modes Подробнее... | |
Переменные | |
| UINT32 | u32Devicetype = (DEVICE_PROFILE_TYPE) |
| 0x1000 (Device type) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | sEntryDesc0x1000 = {DEFTYPE_UNSIGNED32, 0x20, ACCESS_READ} |
| 0x1000 (Device type) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1000 [] = "Device type" |
| 0x1000 (Device type) object name Подробнее... | |
| UINT16 | u16ErrorRegister = 0x0 |
| 0x1001 (Error Register) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | sEntryDesc0x1001 = {DEFTYPE_UNSIGNED8, 0x08, ACCESS_READ} |
| 0x1001 (Error Register) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1001 [] = "Error register" |
| 0x1001 (Error Register) object name Подробнее... | |
| CHAR | acDevicename [] = DEVICE_NAME |
| 0x1008 (Device name) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | sEntryDesc0x1008 = {DEFTYPE_VISIBLESTRING, BYTE2BIT(DEVICE_NAME_LEN), ACCESS_READ} |
| 0x1008 (Device name) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1008 [] = "Device name" |
| 0x1008 (Device name) object name Подробнее... | |
| CHAR | acHardwareversion [] = DEVICE_HW_VERSION |
| 0x1009 (Hardware version) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | sEntryDesc0x1009 = {DEFTYPE_VISIBLESTRING,BYTE2BIT(DEVICE_HW_VERSION_LEN), ACCESS_READ} |
| 0x1009 (Hardware version) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1009 [] = "Manufacturer Hardware version" |
| 0x1009 (Hardware version) object name Подробнее... | |
| CHAR | acSoftwareversion [] = DEVICE_SW_VERSION |
| 0x100A (Software version) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | sEntryDesc0x100A = {DEFTYPE_VISIBLESTRING,BYTE2BIT(DEVICE_SW_VERSION_LEN), ACCESS_READ} |
| 0x100A (Software version) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x100A [] = "Manufacturer Software version" |
| 0x100A (Software version) object name Подробнее... | |
| TOBJ1018 | sIdentity = {4, (VENDOR_ID), (PRODUCT_CODE), (REVISION_NUMBER), (SERIAL_NUMBER)} |
| 0x1018 (Identity) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | asEntryDesc0x1018 [] |
| 0x1018 (Identity) entry descriptions Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1018 [] = "Identity Object\000Vendor ID\000Product Code\000Revision Number\000Serial Number\000\377" |
| 0x1018 (Identity) object and entry names Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | asEntryDesc0x10F1 [] |
| 0x10F1 (Error settings) entry description Subindex 000 SubIndex 001: Local Error Reaction SubIndex 002: Sync Error Counter Limit Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x10F1 [] = "Error Settings\000Local Error Reaction\000Sync Error Counter Limit\000\377" |
| 0x10F1 (Error settings) object and entry names Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | sEntryDesc0x10F8 = { DEFTYPE_UNSIGNED64, 0x40, ACCESS_READWRITE | OBJACCESS_TXPDOMAPPING } |
| 0x10F8 (Timestamp object) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x10F8 [] = "Timestamp Object\000\377" |
| 0x10F8 (Timestamp object) object name Подробнее... | |
| TOBJ1C00 | sSyncmanagertype = {0x04, {0x0201, 0x0403}} |
| 0x1C00 (Sync manager type) variable to handle the object data Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | asEntryDesc0x1C00 [] |
| 0x1C00 (Sync manager type) entry descriptions Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1C00 [] = "Sync manager type" |
| 0x1C00 (Sync manager type) object name Подробнее... | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM | asEntryDesc0x1C3x [] |
| 0x1C3x (SyncManager parameter) entry description Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1C32 [] = "SM output parameter\000Synchronization Type\000Cycle Time\000\000Synchronization Types supported\000Minimum Cycle Time\000Calc and Copy Time\000\000Get Cycle Time\000Delay Time\000Sync0 Cycle Time\000SM-Event Missed\000Cycle Time Too Small\000Shift Time Too Short Counter\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000Sync Error\000\377" |
| 0x1C32 (SyncManager 2 parameter) object and entry names Подробнее... | |
| OBJCONST UCHAR OBJMEM | aName0x1C33 [] = "SM input parameter\000Synchronization Type\000Cycle Time\000\000Synchronization Types supported\000Minimum Cycle Time\000Calc and Copy Time\000\000Get Cycle Time\000Delay Time\000Sync0 Cycle Time\000SM-Event Missed\000Cycle Time Too Small\000Shift Time Too Short Counter\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000Sync Error\000\377" |
| 0x1C33 (SyncManager 3 parameter) object and entry names Подробнее... | |
| TOBJECT OBJMEM * | ObjDicList = NULL |
| Object dictionary pointer. Подробнее... | |
| TOBJECT OBJMEM | GenObjDic [] |
| List of generic application independent objects. Подробнее... | |
Implementation This file contains an example for CoE services and the CoE object dictionary.
Changes to version V5.12:
V5.13 CIA402 3: change define "CIA402_DEVICE" to "CiA402_SAMPLE_APPLICATION"
V5.13 COE1: handling objects with 255 entries
V5.13 COE10: change 0x10F1.1 access from "rw" to "ro"
V5.13 COE2: handle Backup entries with the code VAR
V5.13 COE6: add 0x10F0.2 (Backup parameter changed)
V5.13 COE7: define 0x1C3x.13 Shift Time too short, just define variable because expected in DC mode but shift mode is not supported by the SSC
Changes to version V5.11:
V5.12 COE1: load backup value after the complete OD was initialized
V5.12 COE4: add time stamp object (0x10F8) and update diagnosis handling
V5.12 COE8: fix invalid size calculation to init backup entries
V5.12 ECAT1: update SM Parameter measurement (based on the system time), enhancement for input only devices and no mailbox support, use only 16Bit pointer in process data length caluclation
V5.12 ECAT5: update Sync error counter/flag handling,check enum memory alignment depending on the processor,in case of a polled timer disable ESC interrupts during DC_CheckWatchdog
Changes to version V5.10:
V5.11 COE1: update invalid end entry in the object dictionaries (error with some compilers)
V5.11 COE3: change 0x10F3.2 (Sync Error limit) from UINT32 to UINT16 (according to the ETG.1020)
V5.11 ECAT10: change PROTO handling to prevent compiler errors
V5.11 ECAT4: enhance SM/Sync monitoring for input/output only slaves
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 COE2: Change return value of Get ObjectSize to UINT32
Change object size to UINT32
V5.10 ECAT13: Update Synchronization 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.0:
V5.01 APPL3: Include library demo application
V5.01 COE1: Remove alignment entry (SI33) from objects 0x1C32/0x1C33
V5.01 EL9800 1: Read/Write functions for setting object 0x8020 moved to el9800appl.c
V5.01 EL9800 2: Add TxPdo Parameter object 0x1802
V5.01 SDO6: Update SDO response interface handling. (used if the object access function returns "ABORTIDX_WORKING" and SDO_RES_INTERFACE is active)
Changes to version V4.40:
V5.0 TEST1: Add test application. See Application Note ET9300 for more details.
V5.0 COE1: Add reserved Subindex7 to object 0x1C32 and 0x1C33.
V5.0 COE4: Create object dictionary on device startup.
V5.0 COE6: Update entry descriptions for object with the code ARRAY.
V5.0 ECAT2: Reference to application specific object dictionary is set to "ApplicationObjDic".
Changes to version V4.30:
V4.40 COE 6: change dynamic object dictionary handling
V4.40 CiA402 2: enable freerun Sync Mode for CiA402 Device (The motion controller application will only be triggered if DC Synchronisation is disabled)
V4.40 COE5: move identification and synchronisation object values to ecat_def.h
V4.40 DIAG1: Add diagnosis object 0x10F3
V4.40 OBJ3: Update the global object dictionary pointer if a new list head is added
V4.40 COE4: Prevent access NULL pointer
V4.40 SYNC1: Initialize 0x1C3x objects
V4.40 HW1: Add (adapt) objects for FC1100 support
Changes to version V4.20:
V4.30 OBJ 3: Handle object dictionary in double link list
V4.30 OBJ 2: General EtherCAT device objects are moved from chnappl.h to coeappl.c
V4.30 SYNC: set 0x1C32:05; 0x1C33:05 (minCyleTime) to MIN_PD_CYCLE_TIME (should be set dynamic if required)
V4.30 PDO: rename PDO specific function calls (PDO specific functions are moved to ecatappl.c)
V4.20 PIC24: Add EL9800_4 (PIC24) required source code
V4.11 ECAT 1: C166: MinDelayTime renamed in CalcAndCopyTime
Changes to version V4.07:
V4.10 ECAT 1: To save and restore arrays in the object directory.
The code to get the size of an array entry was changed.
V4.10 COE 1: The SM-Parameter were extended
Changes to version V4.06:
V4.07 COEAPPL 1: The PDO numbers were adapted according top the modular device profile,
the PDO numbers increment now with every module (in chnappl.h)
V4.07 COEAPPL 2: The example is working for the NIOS with the evaluation board DBC2C20 V1.2
which is available by Altera
V4.07 ECAT 1: The sources for SPI and MCI were merged (in ecat_def.h
set the switch MCI_HW to 1 when using the MCI,
set the switch SPI_HW to 1 when using the SPI
Changes to version V4.03:
V4.04 SDO 1: The SDO interface was changed in that way that a SDO response
could be sent by the application to a later time. In that case
the functions OBJ_Read and OBJ_Write shall return the value
ABORTIDX_WORKING. To send the SDO response the new function SDOS_SdoRes
has to be called by the application. While waiting for the call
of SDOS_SdoRes the SDO interface will answer to another SDO request
with the error MBXERR_SERVICEINWORK in the mailbox protocol.
In this example the reading and writing of object 0x8020 is delayed,
the function SDOS_SdoRes will be called from COE_Main.
Changes to version V4.00:
V4.01 COEAPPL 1: The object dictionary and the mapping functions are now defined
in chnappl.h (chnappl.inc made problems with some developing tools)
Changes to version V3.20:
V4.00 COEAPPL 1: The object dictionary and the mapping functions are now defined
in chnappl.c and were adapted to the modular device profile
V4.00 COEAPPL 2: The handling of backup parameters was included according to
the EtherCAT Guidelines and Protocol Enhancements Specification
V4.00 COEAPPL 3: The handling of the TxPDO Toggle was included according to
the EtherCAT Guidelines and Protocol Enhancements Specification
V4.00 COEAPPL 4: The handling of the TxPDO State was included according to
the EtherCAT Guidelines and Protocol Enhancements Specification
V4.00 ECAT 1: The handling of the Sync Manager Parameter was included according to
the EtherCAT Guidelines and Protocol Enhancements Specification
См. определение в файле coeappl.c