BECKHOFF ET9300 User Manual

Page 35

Advertising
background image

Application Note ET9300

33

/**************************************************************************
* Object 0x7010: output values object
**************************************************************************/

#ifdef _OBJD_
OBJCONST TSDOINFOENTRYDESC OBJMEM asEntryDesc0x7010[] = {

/* Entry description of Subindex0 */

{DEFTYPE_UNSIGNED8, 0x08, ACCESS_READ},

/* Entry description of the first entry “Value1” */

{DEFTYPE_UNSIGNED32, 0x20, ACCESS_READ | OBJACCESS_RXPDOMAPPING},

/* Entry description of the second entry “Value2” */

{DEFTYPE_UNSIGNED32, 0x20, ACCESS_READ | OBJACCESS_RXPDOMAPPING}};

/* Name of the object and the entries */

OBJCONST UCHAR OBJMEM aName0x7010[] = "Output
values\000Value1\000Value2\000\377";
#endif //#ifdef _OBJD_

/* Structure to handle the object data*/

typedef struct OBJ_STRUCT_PACKED_START {
UINT16 u16SubIndex0;
UINT32 Value1;
UINT32 Value2;
} OBJ_STRUCT_PACKED_END
TOBJ7010;

PROTO TOBJ7010 OutputData
#ifdef _SAMPLE_APPLICATION_
= {0x02, 0x00, 0x00}
#endif
;

3. File: sampleappl.h

Add information about the new process data to the PDO mapping objects.
The changed code is marked bold red.
NOTE: This step is required to have consistent process data information.

Definition for RxPDO (0x1601) (handling the output process data)

/**************************************************************************
* Object 0x1601: RxPDO
**************************************************************************/

#ifdef _OBJD_
OBJCONST TSDOINFOENTRYDESC OBJMEM asEntryDesc0x1601[] = {
{DEFTYPE_UNSIGNED8, 0x8, ACCESS_READ },
{DEFTYPE_UNSIGNED32, 0x20, ACCESS_READ},

/* reference to the new process data. The information does NOT describe the
process data itself, that means if the process data is an UNSIGNED8 value
the deftype in this description is still UNSIGNED32*/

{DEFTYPE_UNSIGNED32, 0x20, ACCESS_READ}

};

/* Only the object name is described all entries are automatically names as
“SubIndex 000” (000 is incremented for each entry) */

OBJCONST UCHAR OBJMEM aName0x1601[] = "RxPDO-Map\000\377";
#endif //#ifdef _OBJD_

typedef struct OBJ_STRUCT_PACKED_START {
UINT16 u16SubIndex0;

/* Add one additional array element for the reference to the new process
data */

UINT32 aEntries[

2

];

} OBJ_STRUCT_PACKED_END
TOBJ1601;

PROTO TOBJ1601 RxPDOMap

Advertising