7 objects, 1 design/structure rules, 2 define local memory – BECKHOFF ET9300 User Manual

Page 43: Objects, Design/structure rules, Define local memory

Advertising
background image

Application Note ET9300

41

7

Objects

Objects are slave application data (e.g. variables) which can be accessed by the EtherCAT master via
CoE or process data communication.
An object is uniquely defined by the following characteristics:

-

Local memory (7.2 Define local memory)

-

Entry Description (7.3 Entry description)

-

Object Name (7.4 Object name)

-

OBJECT DESCRIPTION (7.5OBJECT DESCRIPTION)

The characteristics for all objects are collected in one panel, the Object Dictionary. This dictionary
represents the interface for the EtherCAT master access the application data via CoE. In this
paragraph we classify the objects into three different Object Codes: VARIABLE, ARRAY and
RECORD. The VARIABLE includes just one base data type as one object. The ARRAY is a collection
of identical base data types as one object. The RECORD includes a collection of different base data
types as one object.

7.1

Design/Structure Rules

-

Entries less or equal one 8Bit shall not overlap byte borders.

-

Entries greater 8Bit shall always start at an exact word border.

To get the required alignment the defines

“ALIGNyy(x)” (yy : 1..15) can be used (see ecatappl.h).

NOTE: If these rules cannot be matched a read/write callback function need to be registered in the
object dictionary.

7.2

Define local memory

The allocation of the local memory depends on the Object Code (VARIABLE, ARRAY or RECORD)
which will be used.

In most cases for the Object Code VARIABLE it is sufficient to allocate memory by definition of a
variable - if the desired object size is equal to a platform defined data type.

Example: Define local memory (Object Code VARIABLE)

UINT32 u32VarObject;

The other two Object Codes (ARRAY and RECORD) will be defined by structure. This contains an
8Bit variable as first member (Subindex0), which contains the highest subindex (last Object Entry).
Note: in The Slave Stack Code the Subindex0 will always be defined as 16Bit variable due to
alignment reasons!

Example: Define local memory (Object Code ARRAY)

typedef struct {
UINT16 u16SubIndex0 ;
UINT32 aEntries[4];
} _ARR_OBJ_DEF;

_ARR_OBJ_DEF ArrObj;

Example: Define local memory (Object Code RECORD)

typedef struct {
UINT16 u16SubIndex0;
UINT8 u8FirstEntry;
UINT32 u32SecondEntry;
INT16 i16ThirdEntry;
} _REC_OBJ_DEF;

Advertising