BECKHOFF ET9300 User Manual

Page 36

Advertising
background image

34

Application Note ET9300

#ifdef _SAMPLE_APPLICATION_
= {

2

/*the object has now two entries*/

, {0x70100120,

0x70100220

/* Reference

to object 0x07010 Subindex2 and 32Bit length */

}}

#endif
;

Definition for TxPDO (0x1A00) (handling the input process data)

/**************************************************************************
* Object 0x1A00: TxPDO
**************************************************************************/

#ifdef _OBJD_
OBJCONST TSDOINFOENTRYDESC OBJMEM asEntryDesc0x1A00[] = {
{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 aName0x1A00[] = "TxPDO-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
TOBJ1A00;

PROTO TOBJ1A00 TxPDOMap
#ifdef _SAMPLE_APPLICATION_
= {

2

/*the object has now two entries*/

, {0x60000020,

0x60100020

/* Reference

to object 0x06010 Subindex0 and 32Bit length */

}}

#endif
;

4. File: sampleappl.h

Add/Update the references in the object dictionary

TOBJECT OBJMEM ApplicationObjDic[] = {
/* Object 0x1601 */
{NULL,NULL, 0x1601, {DEFTYPE_PDOMAPPING,

2

| (OBJCODE_REC << 8)},

asEntryDesc0x1601, aName0x1601, &RxPDOMap, NULL, NULL, 0x0000 },
/* Object 0x1A00 */
{NULL,NULL, 0x1A00, {DEFTYPE_PDOMAPPING,

2

| (OBJCODE_REC << 8)},

asEntryDesc0x1A00, aName0x1A00, &TxPDOMap, NULL, NULL, 0x0000 },


/* Object 0x6010 */
{NULL,NULL, 0x6010, {DEFTYPE_UNSIGNED32, 0 | (OBJCODE_VAR << 8)},
&EntryDesc0x6010, aName0x6010, &ResultObj6010, NULL, NULL, 0x0000 },

/* Object 0x7010 */
{NULL,NULL, 0x7010, {

DEFTYPE_RECORD, 2 | (OBJCODE_REC

<< 8)},

asEntryDesc0x7010

, aName0x7010, &

OutputData

, NULL, NULL, 0x0000 },

{NULL,NULL, 0xFFFF, {0, 0}, NULL, NULL, NULL, NULL}};

5. File: sampleappl.c

Update the expected process data size (which is similar to the size of the corresponding

Advertising