7 implementation examples, 1 usage of object deftype enum, Implementation examples – BECKHOFF ET9300 User Manual
Page 47: Usage of object deftype enum
Application Note ET9300
45
Index Range
Description
0xA000
– 0xAFFF
Diagnosis Area
0xB000
– 0xBFFF
Service Transfer Area
0xC000
– 0xEFFF
Reserved Area
0xF000h
– 0xFFFF
Device Area
If the EtherCAT slave supports CiA402 drive profile the object range 0x6000
– 0xDFFF is subdivided
according to [1] . The CiA402 objects used in the CiA402 sample listed in 10.1Objects.
The object indices used in the EL9800 Application are used according to the Modular device Profile
(Figure 4: EL9800 Application object ranges).
RxPDO (Outputs) 0x16xx
0x1601
Output Entries 0x7xxx
0x7010
TxPDO (Inputs) 0x1Axx
0x1A00
0x1A02
Input Entries 0x6xxx
0x6000
0x6020
Configuration Parameter 0x8xxx
0x8020
Configuration Area
0x1000
– 0x1FFF
Device Parameter
0xF000
– 0xFFFF
El9800 Base Objects
Digital Inputs
Digital Outputs
Analog Inputs
Figure 4: EL9800 Application object ranges
7.7
Implementation examples
7.7.1
Usage of Object Deftype ENUM
Each Enum Object definition shall be within the index range 0x800
– 0x0FFF. The content of an Enum
definition is described in [2] .
For each enum Value a 4Byte unsigned integer Value and a Name is defined. The 4Byte unsigned
integer is Byte wise Octed coded .
e.g: "\058\000\000\000EnumValueName"
“\058” = 5*8 + 8 = 48 = 0x30
=> “EnumValueName” = 0x00000030 = 48
Example: Define Object Deftype ENUM
CHAR sEnum0801_Value00[] = "\000\000\000\000Startup"; /* Value = 0x00, Text
= Startup*/
CHAR sEnum0801_Value01[] = "\001\000\000\000Runnig"; /* Value = 0x01, Text
= Runnig*/
CHAR sEnum0801_Value02[] = "\012\000\000\000End"; /* Value = 0xA, Text =
End*/
CHAR *apEnum0801[] = { sEnum0801_Value00, sEnum0801_Value01,
sEnum0801_Value02};
OBJCONST TSDOINFOENTRYDESC
OBJMEM asEntryDesc0x0801[] =
{{DEFTYPE_UNSIGNED8, 8, ACCESS_READ | OBJACCESS_NOPDOMAPPING},