Hello, everyone!
I have met some problems when i want to perform EtherCAT CoE SDO operation.
I've creat object with ECAT_OD_CREATE_OBJECT_REQ, ECAT_OD_CREATE_SUBOBJECT_REQ, and ECAT_OD_NOTIFY_REGISTER_REQ. Each step is right, receiving the right confirmation value(ulSta=0, ulCmd=+1). But when i use TwinCAT to read or write this object via sdo service, it returns 'general error 0x08000000' or 'data can not be transferred or stored to the application because of local control 0x08000021'.
ps. i've set this object as input and output value, and the concerned flags are set according to the description in the api.
pps. there is no reaction in the handshake cell, and there is no packet in the mailbox. I don't receive a ECAT_OD_NOTIFY_READ_IND or ECAT_OD_NOTIFY_WRITE_IND at all.
Why does that appear?
Hello Johnny!
Thank you for your reply! I have solved the problems.
But I have met another question that when i set the object's subobject's number and maxnumber >3(any), and i created 2 subobjects, when i created the 2nd subobject, the stack replied an error 0xc0280019(subobject already exist).why?
How can i create more than 1 subobjects?
And what's the differences between number and maxnumber in creation of object?
Thank you!
Hello liuyan,
the CreateObject is wrong.
you have to change:
00 00 00 00 40 60 01 03 00 3F 00 07 00 02 00 00 00 00 00
to
00 00 00 00 40 60 01 03 00 3F 00 08 00 02 00 00 00 00 00 or
00 00 00 00 40 60 01 03 00 3F 00 09 00 02 00 00 00 00 00
The max-number defines the maximum number of valid subindexes.
The index 0 specifies the currently available number of objects. (for example PDO Mapping allows to change that to activate/deactivate the mapping).
Greetz,
code-small
Thank you! I have solve the problem.
i have created my OD and registered them, and i can get their information over TwinCAT on the CoE-Online tag now and then, but not every time. And the TwinCAT offen gives that message "Data cannot be transferred or strored to the application because of local control",0x08000021.
And I use the cifX50 as master, and i use ETHERCAT_MASTER_CMD_GET_ODLIST_REQ, the result is right sometimes, but most of the time, the master replies the COE timeout message.
i can read or write the objects' data,i have registered write and read operation. Is there any thing that i have miss?
Hello liuyan,
Have you done the following with the indication to create a response?
1. Copy packet header
2. Set ulCmd to (ulCmd | 1)
3. Set ulSta = TLR_S_OK (in case the write is successful)
4. Set ulLen = size of response
5. Send that packet back to through the communication channel.
If not, the stack will time out and there will be exactly that error send to TwinCAT.
Greets,
code-small
Hello code-small!
Thank you for your reply. But I think I didn't decribe it clearly. I have create my OD and I have registered them and read-write service.And I can read or write them by using cifx50.
My problem is
1. When I use TwinCAT to get the OD list on CoE-Online tag, nine out of ten times i can't read the whole OD list, and one or two times TwinCAT get the right list.
2.And when I use the cifX50 as master, use ETHERCAT_MASTER_CMD_GET_ODLIST_REQ to get the OD list, the same problem happens:most of the time, the master replies the COE timeout message, one time or two out of ten times i can recieve the OD list.
3.I didn't register the get OD list service, I think the stack execute the operation
Hello liuyan,
can you please make a wireshark capture and send that via email?
Greets,
code-small
Hello liuyan,
As I can see within your PM, the stack did respond with that error code on 0x1008.
So, have you registered for Read indications on that one?
TwinCAT will read all objects on the CoE online tab. Therefore, it would not be possible to do the indications manually. You have to have a little program running on the DPM doing the indications.
Greetz,
code-small
Hello code-small!
Thank you for your patience very much! i have solve the problem.
Johnny
Hello liuyan,
I have tested the Slave Firmware V2.4.2 together with the Hilscher EtherCAT Master.
I used a CIFX50-RE
The following test procedure worked as expected (all packets have ulDest = 0x20):
1.) Send packet ECAT_DPM_SET_CONFIGURATION_REQ (ulCmd=0x00002CCA) with data
2.) I executed a ChannelInit (Warmstart) to the slave.
3.) I generated the Master config and brought the bus to data exchange (OPERATIONAL)
4.) on Slave side send CreateObject (ulCmd=0x1B00)
40 60 01 02 04 00 07 07 005.) on Slave side send CreateSubObject (ulCmd=0x1B02)
00 00 00 00 40 60 01 03 00 3F 00 07 00 02 00 00 00 00 006.) on Slave side send RegisterNotify (ulCmd=0x1B10) Read and Write Indications are enabled
4060 01000000 010000007.) on master side thy to read the object 0x6040.1
8.) on slave side the following indication is received (ulCmt=0x1B14)
40 60 01 04 00 00 00