And with the library ETC_CO_SdoWrite, I want to send some SDOs.
The objects with size lower than 5 bytes work's perfectly but with the others (more than 4), I get an error. In fact, I don't know why, CoDeSys is supposed to send a segmented object, the first SDO is correct, he send an "initiate download protocol" and then after he should send a "segmented" one but he send again the same "initiate download protocol" .
What I made wrong ?
thank you in advance
in the following, my function ETC_CO_SdoWrite and a capture of what is sent :
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Another thing to make sure of at least from V2.3 days and since I can't see all your code. You should make sure that only one SDO is active at a time by monitoring the Done Busy outputs.
With CANopen it is understandable because you get the response code back from the SDO write. If it failed the SDO fail code is included in the returned value. I missed this the first time. Do you have a list of the SDO abort codes?
The code 05040001xh returned is:
Zitat:
Client/Server command specifier not valid or unknown
What is the usiChannel? What device profile is the SDO targeting ds401? Also I noticed that the szSize = 6? I'm not sure what size is but it may be relating to the size of data in the SDO since you can have two types standard transferring 4 bytes or block download transferring as many as 889 bytes. Since the SDO is in the MFG index area my guess is it is suppose to be a 4 byte download in the form Index,SubIndex,Data. Try using 4 as the szSize.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got the same abort code, which is correct because the 2nd sdo is not correct, it should be a segmented one
Regarding to the codesys doc, UsiChannel is "Reserved for future extensions. Currently not used."
The device profile is dsp402 (drive) and it doesn't support sdo block transfer. That's why as far I know, you must use SDO normal for data more than 4 bytes. With 4 bytes, it's work fine
Zitat:
The PC send : 21 10 64 01 09 00 00 00
device answer : 60 10 64 01 00 00 00 00
The PC send : 00 xx xx xx xx xx xx xx
device answer : 20 00 00 00 00 00 00 00
The PC send : 1B xx xx 00 00 00 00 00
device answer : 30 00 00 00 00 00 00 00
and everyone will be happy !
Is someone can tell me if I su*k and normaly it's working ?
Thanks
(I'm using codesys v3.3 patch 1)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everybody,
I'm tring to use Codesys v3 with a CoE device.
And with the library ETC_CO_SdoWrite, I want to send some SDOs.
The objects with size lower than 5 bytes work's perfectly but with the others (more than 4), I get an error. In fact, I don't know why, CoDeSys is supposed to send a segmented object, the first SDO is correct, he send an "initiate download protocol" and then after he should send a "segmented" one but he send again the same "initiate download protocol" .
What I made wrong ?
thank you in advance
in the following, my function ETC_CO_SdoWrite and a capture of what is sent :
Hi Aurelien,
thats just a guess but maybee it helps:
Try the ETC_CO_SEGMENTED mode maybee this helps
regards
Ralph
thanks Ralf, with ETC_CO_SEGMENTED, still don't work
Another thing to make sure of at least from V2.3 days and since I can't see all your code. You should make sure that only one SDO is active at a time by monitoring the Done Busy outputs.
Hi spfeif, in my program, there is only this FB TC_CO_sdoWrite, nothing else.
The variable xDone, never change to TRUE. The FB is started by xExecute = TRUE then at the next PLC cycle, eError = TRUE;
With a task cycle of 10ms, the first "sdo" is sent and the other one arround 4ms later.
Is anybody who already used this function ?
Thank you
With CANopen it is understandable because you get the response code back from the SDO write. If it failed the SDO fail code is included in the returned value. I missed this the first time. Do you have a list of the SDO abort codes?
The code 05040001xh returned is:
What is the usiChannel? What device profile is the SDO targeting ds401? Also I noticed that the szSize = 6? I'm not sure what size is but it may be relating to the size of data in the SDO since you can have two types standard transferring 4 bytes or block download transferring as many as 889 bytes. Since the SDO is in the MFG index area my guess is it is suppose to be a 4 byte download in the form Index,SubIndex,Data. Try using 4 as the szSize.
Thank you for your help spfeif,
I got the same abort code, which is correct because the 2nd sdo is not correct, it should be a segmented one
Regarding to the codesys doc, UsiChannel is "Reserved for future extensions. Currently not used."
The device profile is dsp402 (drive) and it doesn't support sdo block transfer. That's why as far I know, you must use SDO normal for data more than 4 bytes. With 4 bytes, it's work fine
For example, actualy, with size = 9 bytes,
a correct sequence could be this :
and everyone will be happy !
Is someone can tell me if I su*k and normaly it's working ?
Thanks
(I'm using codesys v3.3 patch 1)