![]() |
ECAT_Slave_in_ПЧ2П_c402
0.8
Реализация EtherCAT Slave для CM TMS320F28388D
|
Implementation This file contains the object dictionary access functions. Подробнее...
#include "ecat_def.h"#include "ecatslv.h"#include "coeappl.h"#include "objdef.h"#include "applInterface.h"Макросы | |
| #define | OBJDEF 0x4000 |
| #define | OBJDEFMAX 0x0A |
| #define | _OBJDEF_ 1 |
Функции | |
| OBJCONST TSDOINFOENTRYDESC OBJMEM * | OBJ_GetEntryDesc (OBJCONST TOBJECT OBJMEM *pObjEntry, UINT8 Subindex) |
| The function returns the Entry-Desc of a subindex to allow the application to define the object dictionary independent of the sdoserv-files. Подробнее... | |
| OBJCONST TOBJECT OBJMEM * | OBJ_GetObjectHandle (UINT16 index) |
| The function looks in all objects of the dictionary after the indicated index and returns a handle if found. Подробнее... | |
| UINT32 | OBJ_GetObjectLength (UINT16 index, UINT8 subindex, OBJCONST TOBJECT OBJMEM *pObjEntry, UINT8 bCompleteAccess) |
| This function returns the size of the requested entry. If bCompleteaccess is set the size of the complete object is returned (the returned size is byte packed, gaps based on the used platform/compiler are not taken into account) Подробнее... | |
| void | OBJ_CopyNumberToString (UCHAR MBXMEM *pStr, UINT8 Number) |
| The function copies the Number in the string pStr, which shall be initialized with 000. Подробнее... | |
| UINT16 | OBJ_GetNoOfObjects (UINT8 listType) |
| The function counts the number of objects of the requested list type. Подробнее... | |
| UINT16 | OBJ_GetObjectList (UINT16 listType, UINT16 *pIndex, UINT16 size, UINT16 MBXMEM *pData, UINT8 *pAbort) |
| The function copies (the part of) the object list in the mailbox buffer. Подробнее... | |
| UINT16 | OBJ_GetDesc (UINT16 index, UINT8 subindex, OBJCONST TOBJECT OBJMEM *pObjEntry, UINT16 MBXMEM *pData) |
| The function returns size and description string of the requested entry. Подробнее... | |
| OBJCONST TSDOINFOOBJDESC OBJMEM * | OBJ_GetObjDesc (OBJCONST TOBJECT OBJMEM *pObjEntry) |
| The function returns the Obj-Desc of an object to allow the application to define the object dictionary independent of the sdoserv-files. Подробнее... | |
| UINT16 | OBJ_GetEntryOffset (UINT8 subindex, OBJCONST TOBJECT OBJMEM *pObjEntry) |
| This function calculates the bit offset of the entry in the object's variable. Подробнее... | |
| UINT8 | CheckSyncTypeValue (UINT16 index, UINT16 NewSyncType) |
| Checks if the new Sync type value is valid. Подробнее... | |
| UINT8 | OBJ_Read (UINT16 index, UINT8 subindex, UINT32 objSize, OBJCONST TOBJECT OBJMEM *pObjEntry, UINT16 MBXMEM *pData, UINT8 bCompleteAccess) |
| This function reads the requested object. Подробнее... | |
| UINT8 | OBJ_Write (UINT16 index, UINT8 subindex, UINT32 dataSize, OBJCONST TOBJECT OBJMEM *pObjEntry, UINT16 MBXMEM *pData, UINT8 bCompleteAccess) |
| This function writes the requested object. Подробнее... | |
Переменные | |
| OBJCONST TOBJECT OBJMEM * | pSdoInfoObjEntry |
| const UINT16 | cBitMask [16] = {0x0000,0x0001,0x0003,0x0007,0x000F,0x001F,0x003F,0x007F,0x00FF,0x01FF,0x03FF,0x07FF,0x0FFF,0x1FFF,0x3FFF,0x7FFF} |
Implementation This file contains the object dictionary access functions.
Changes to version V5.12:
V5.13 COE1: handling objects with 255 entries
V5.13 COE4: update default entry name handling in case of 16Bit characters, add CoE Read/write indication functions
V5.13 COE9: prevent compiler warning in get entry description if char is 8bit
V5.13 TEST7: add entries with bit9-16 types
Changes to version V5.11:
V5.12 COE10: update object entry string handling
V5.12 COE3: update entry access right handling
V5.12 COE6: handle get object length in case of an out of range subindex
V5.12 COE7: in case of a padding entry SDO upload/download return Unsupported access
V5.12 COE9: SDO download 0xF030.0 shall be 0 before writing entries 1..n
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.1:
V5.11 DIAG4: change parameter handling in DIAG_CreateNewMessage()
V5.11 ECAT:
V5.11 ECAT10: change PROTO handling to prevent compiler errors
V5.11 ESM7: "add Sync define for 0x22 (""SYNCTYPE_SM2_SYNCHRON""), support value 0x22 for 0x1C33.1 (SM2 sync)"
V5.11 OBJ1: OBJ_GetEntryOffset: return offset 0 for si0 (always offset 16 was returned before)
V5.11 SDO1: "Obj_Read/Obj_Write: Check if entries > 8bit has even word offset (otherwise ""unsupported access"" is returned). To support these object a read/write callback function need to be used (see Application Note ET9300)"
V5.11 SDO2: Obj_Read/Obj_Write: Handle arrays (string, array of byte, ...) with an odd word length (buffer shift was wrong). Only an entry <=8Bit is allowed after such an entry.
V5.11 SDO3: handle not word aligned enums
V5.11 SDO5: add missing swapping on SI0 write access
V5.11 SDO6: OBJ_GetDesc ensure that the default string is used if no string was found
V5.11 SDO7: add missing value swapping if memory values are bitwise modified on object read/write access
V5.11 SDO9: "handle SDO access for entries which are not accessible (in case of SDO complete access), SDO access handle ""DEFTYPE_ARRAY_OF_INT"" , ""DEFTYPE_ARRAY_OF_SINT"" , ""DEFTYPE_ARRAY_OF_DINT"" , ""DEFTYPE_ARRAY_OF_UDINT"", SDO access handle : ""BYTE"" , ""WORD"" and ""DWORD"""
V5.11 TEST2: add test 0x300C object (entry bitlength > 65535)
V5.11 TEST8: create diag message on SDO write access to 0x3002
Changes to version V5.01:
V5.10 COE2: Change return value of Get ObjectSize to UINT32
Change object size to UINT32
V5.10 ECAT11: Add define "USE_SINGLE_PDO_MAPPING_ENTRY_DESCR" (Only one entry description is required for all PDO mapping entries)
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
V5.10 ECAT3: Add new datatype handling (BITARRxx)
Use read/write macro to access STRING entries
V5.10 SDO1: Handle access to enums on odd memory addresses (only for MBX_16BIT_ACCESS)
V5.10 SDO2: Check for termination char in every substring
V5.10 SDO5: Check also for PDO mapping object if the subindex 0 was set to 0 before the entries will be changed.
V5.10 SDO9: SDO complete write access update buffer offset calculation in case of SI0 is readonly
V5.10 TEST2: Add 0x3004.14 (Access to this entry will always rejected with the code "cannot be acceesd because of local control")
V5.10 TEST4: Add CoE test (0x2020.5) to return always max object data on complete access (not limited to value of SI0)
Changes to version V5.0:
V5.01 COE2: Calculate the bit offset also for SI0 in case if an SDO download access.
V5.01 SDO1: Update alignment entry handling.
V5.01 SDO5: Update offset calculation in case of an not accessible entry
V5.01 SDO7: Update object length calculation in case of an BitArray
V5.01 TEST5: Add slave configuration object handling (0x8000, if test application is active)
V5.01 TEST6: Add test to create dummy object dictionary.
Changes to version V4.40:
V5.0 TEST1: Add test application.
V5.0 COE3: Update OCTED_STRING and VISIBLE_STRING read/write.
V5.0 COE5: Add BigEndian support for enum SDO read, handle complete access also for objects with align or not existing entries.
V5.0 COE7: Support SDO Info entry name handling for 16Bit access
V5.0 DIAG2: SDO Info request for diagnosis messages 0x10F3 SI5 or greater return always description of SI6.
V5.0 COE2: Add plausibility check for PDO assign objects.
V5.0 OBJ2: Support DWORD/WORD aligned object structures.
V5.0 SDO7: Update SDO read/write for object(entries) less or equal 8Bit.
Changes to version V4.30:
V4.40 DIAG1: Add diagnosis access functions
V4.40 OBJ2: change counter variable to prevent deadlock caused by overrun (required if subindex0 is 255)
V4.40 COE2: Prevent accessing empty object dictionary entry
V4.40 COE3: Read whole object dictionary
V4.40 COE1: Prototype of OBJ_GetObjectList() changed, set abort code if object dictionary is empty
V4.30 OBJ 3: Object dictionary list handling
V4.30 OBJ 2: fix SDO complete access bug
V4.11 OBJ 1-3: OBJ_GetDesc() Now, subindex 0 instead of 0xFF is used to return the description of the whole object
Subindex 0xFF could be used like a normal subindex.
Changes to version V4.08:
V4.10 OBJ 1: calculate size of PdoObjectEntry Index 1 and not Index 0
V4.10 OBJ 2: the pointer of the object dictionary will be get by a function (COE_GetObjectDictionary)
Changes to version V4.07:
V4.08 OBJ 1: if subindex 0 is writable, the maximum subindex should be checked in an object specific function,
because for the PDO mapping and PDO assign the object shall only be written if subindex 0 is 0.
Changes to version V4.04:
V4.04 OBJ 1: The loop in OBJ_GetObjectList was one subindex too low
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
V4.04 OBJ 1: The loop in OBJ_GetNoOfObjects was one subindex too low
Changes to version V4.02:
V4.03 OBJ 1: The object list was not returned correctly for the list types 2-5
Changes to version V3.20:
V4.00 OBJ 1: The OBJ functions are modified for a more flexible definition of
the object dictionary and to support bit types too
V4.00 SDO 2: The object lists will be generated in the functions OBJ_GetNoOfObjects
and OBJ_GetObjectList in objdef.c to decouple the SDO services from
the implementation of the object dictionary
V4.00 COEAPPL 2: The handling of backup parameters was included according to
the EtherCAT Guidelines and Protocol Enhancements Specification
См. определение в файле objdef.c