industrialNETworXnetx

th_elste

th_elste

| 09.03.2009 | 11:30 | 5 replies

ECAT_OD_NOTIFY_REGISTER_REQ with C-Toolkit

Hi,

I'm trying to register a SDO write notification using the C-Toolkit (running with a CifX-50Re).

Therefor:
- I'm creating a SDO with one entry
- Send an ECAT_OD_NOTIFY_REGISTER_REQ with the SDOs index to the stack
- poll the channel mailbox for incoming packets

The problem is, as soon as the notification is registered, I can't write the SDO from the master anymore. I always get a "SDO Abort ('general error', 0x08000000)" message when I try. What am I missing?

Thanks in advance
Thomas

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 09.03.2009 | 15:49

Hi,

what for parameters did you use for creating the object?

how does your indication code look like?

Did you set the ulSta(te) field of the packet accordingly?

th_elste

th_elste

| 09.03.2009 | 16:11

Hello AJ,

thanks for your reply. My example SDO object is created using this data:

ECAT_SDO_CREATE_OBJECT_REQ_DATA_T sdo_test;
sdo_test.usIndex=0x6001;
sdo_test.bNumOfSubObj=1;
sdo_test.bMaxSubObjs=1;
sdo_test.usObjAccess=0;
sdo_test.bObjectCode=8;
sdo_test.usDatatype=2;

ECAT_SDO_CREATE_SUBOBJECT_REQ_DATA_T entry;
entry.usMode=0;
entry.usIndex=0x6001;
entry.bSubIdx=0x1;
entry.usDirection=3;
entry.usSubObjAccess=0x3f;
entry.usDatatype=7;
entry.usFieldLen=32;
entry.usRelativeAddress=0;



The SDO shows up in the master and I can read and write it until the notification packet is send:

Dest   : 0x00000001      ID   : 0x00000000
Src    : 0x00000000      Sta  : 0x00000000
DestID : 0x00000000      Cmd  : 0x00001B10
SrcID  : 0x00000000      Ext  : 0x00000000
Len    : 0x0000000A      Rout : 0x00000000
Data:
01 60 00 00 00 00 01 00 00 00 (usIndex=0x6001, fReadNotify=0, fWriteNotify=1)

After that the 'general error' occurs, if I try to write the SDO again.

AJ wrote:
Did you set the ulSta(te) field of the packet accordingly?

ulSta is set to 0.

Regards
Thomas

code-small

code-small

| 09.03.2009 | 17:00

Hi,

did you handle the ECAT_OD_WRITE_NOTIFY_IND indication?

the following actions must be taken for handling this indication:

- process the data
- copy the packet header
- modify ulSta, ulLen accordingly
- set the bit 0 in ulCmd
- send the newly created response packet to the netX

all other packet header fields are inherited from the indication.

Greets,

code-small

th_elste

th_elste

| 09.03.2009 | 17:14

Hello code-small,

code-small wrote:
did you handle the ECAT_OD_WRITE_NOTIFY_IND indication

the problem is, I don't get an indication packet. As I'm working with the C-Toolkit the indication should be readable via the channel mailbox, am I right? So I'm polling for new packets after registering the notification. But none occur when writing the SDO.

Regards
Thomas

code-small

code-small

| 19.03.2009 | 13:08

Hi,

the usFieldLen field is only evaluated in case of variable length data types and with these it specifies the amount of data type units. (e.g. on a VISIBLE_STRING it means the character unit).

In any other case, it is ignored.

Did you check the error codes for the Request packets?

In what state is the slave when you are trying to write the object?

Greets,

code-small

Login