Hi,
I've a little problem with the creation of a custom object dictionary. I'm trying to create simple objects (no arrays or records, this works btw.) in the OD of a cifX slave (via packet, using the C-Toolkit and firmware 2.1.2.0).
For example, if I want to create an unsigned int 32 with index 0x7000, I've tried using the following data for the ECAT_OD_CREATE_OBJECT_REQ and ECAT_OD_CREATE_SUBOBJECT_REQ packets (separately or in combination):
usIndex=0x7000; bNumOfSubObj=1; bMaxSubObjs=1; usObjAccess=6; bObjectCode=OBJCODE_VAR; /* 7 */ usDatatype=OBJTYPE_UNSIGNED32; /* 7 */usMode=ECAT_OD_SUBOBJECT_MODE_STORAGE;
usIndex=0x7000;
bSubIdx=0;
usDirection=ECAT_OD_SUBOBJECT_DIRECTION_NOT_DEF;
usSubObjAccess=ECAT_OD_ACCESS_ALL;
usDatatype=OBJTYPE_UNSIGNED32; /* 7 */
usFieldLen=1;
usRelativeAddress=0;
Although both packets (separately or in combination) get accepted with no error, the object entry is not recognized afterwards by the master. As I've already mentioned, creating array objects (bObjectCode=8) with subobjects works without a problem. So there seems to be no general problem with my code talking to the od stack. Are all the parameters correct? This is almost excatly the example from the ecs protocol manual and probably it's some stupid mistake I've made but I can't find any reason, why this doesn't work.
regards
Thomas
code- small
Hilscher Gesellschaft für Systemautomation mbH
Hi,
due to the implementation of the object dictionary the subIndex value in the ECAT_OD_CREATE_SUBOBJECT_REQ must be 1.
Regards,
code-small