<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/</id><updated>2020-02-27T13:47:41.592000Z</updated><subtitle>Recent posts to CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</subtitle><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#8f4d" rel="alternate"/><published>2020-02-27T13:47:41.592000Z</published><updated>2020-02-27T13:47:41.592000Z</updated><author><name>aurelien</name><uri>https://forge.codesys.com/u/aurelien/</uri></author><id>https://forge.codesys.com61673083a699cedd71861a91366133c0c576b570</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your help spfeif,&lt;/p&gt;
&lt;p&gt;I got the same abort code, which is correct because the 2nd sdo is not correct, it should be a segmented one&lt;/p&gt;
&lt;p&gt;Regarding to the codesys doc, UsiChannel is "Reserved for future extensions. Currently not used."&lt;/p&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;p&gt;For example, actualy, with size = 9 bytes,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
The PC send :    21 10 64 01 09 00 00 00&lt;br/&gt;
device answer : 60 10 64 01 00 00 00 00&lt;br/&gt;
The PC send :    21 10 64 01 09 00 00 00&lt;br/&gt;
device answer : 80 10 64 01 01 00 04 05&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;a correct sequence could be this :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
The PC send :    21 10 64 01 09 00 00 00&lt;br/&gt;
device answer : 60 10 64 01 00 00 00 00&lt;br/&gt;
The PC send :    00 xx xx xx xx xx xx xx&lt;br/&gt;
device answer : 20 00 00 00 00 00 00 00&lt;br/&gt;
The PC send :    1B xx xx 00 00 00 00 00&lt;br/&gt;
device answer : 30 00 00 00 00 00 00 00&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and everyone will be happy !&lt;/p&gt;
&lt;p&gt;Is someone can tell me if I su*k and normaly it's working ? &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;(I'm using codesys v3.3 patch 1)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#afa8" rel="alternate"/><published>2020-02-27T13:47:41.553000Z</published><updated>2020-02-27T13:47:41.553000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.come1f44573a56fc02cf748d74fcb2d979d70497c81</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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?&lt;/p&gt;
&lt;p&gt;The code 05040001xh returned is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
Client/Server command specifier not valid or unknown&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;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.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#ba3c" rel="alternate"/><published>2020-02-27T13:47:41.513000Z</published><updated>2020-02-27T13:47:41.513000Z</updated><author><name>aurelien</name><uri>https://forge.codesys.com/u/aurelien/</uri></author><id>https://forge.codesys.comb978d4b17f94db41273138a28faf5152e4700b58</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi spfeif, in my program, there is only this FB TC_CO_sdoWrite, nothing else.&lt;/p&gt;
&lt;p&gt;The variable xDone, never change to TRUE. The FB is started by xExecute = TRUE then at the next PLC cycle, eError = TRUE; &lt;/p&gt;
&lt;p&gt;With a task cycle of 10ms, the first "sdo" is sent and the other one arround 4ms later.&lt;/p&gt;
&lt;p&gt;Is anybody who already used this function ?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#169a" rel="alternate"/><published>2020-02-27T13:47:41.430000Z</published><updated>2020-02-27T13:47:41.430000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.com78d52050c35058ff072304013103e559fc3e2593</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;case&lt;/span&gt; &lt;span class="nv"&gt;sdoState&lt;/span&gt;
&lt;span class="nv"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;:
&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;Wait&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;program&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;execute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;initSDO&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="nv"&gt;sdoState&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;sdoState&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;end_if&lt;/span&gt;
&lt;span class="nv"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;:
&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;ask&lt;/span&gt; &lt;span class="nv"&gt;type&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;index&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="sc"&gt;#1000&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;subIndex&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;0&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;1&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;2&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;3&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;execute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;true&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;:
&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;set&lt;/span&gt; &lt;span class="nv"&gt;heartbeat&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="nv"&gt;msec&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;index&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="sc"&gt;#1017&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;subIndex&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;0&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;1&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;2&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="mi"&gt;3&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;execute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;true&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="nv"&gt;sdoState&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;end_Case&lt;/span&gt;
&lt;span class="nv"&gt;ETC_CO_sdoWrite&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;Execute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nv"&gt;execute&lt;/span&gt; &lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;ETC_CO_sdoWrite&lt;/span&gt;.&lt;span class="nv"&gt;Done&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
 &lt;span class="nv"&gt;sdoState&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;sdoState&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;end_if&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;ETC_CO_sdoWrite&lt;/span&gt;.&lt;span class="nv"&gt;Error&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="nv"&gt;sdoState&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;end_if&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#919c" rel="alternate"/><published>2020-02-27T13:47:41.399000Z</published><updated>2020-02-27T13:47:41.399000Z</updated><author><name>aurelien</name><uri>https://forge.codesys.com/u/aurelien/</uri></author><id>https://forge.codesys.comcbf23b7fddf69c8132419345c00750923b8486c5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;thanks Ralf, with ETC_CO_SEGMENTED, still don't work  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#b39c" rel="alternate"/><published>2020-02-27T13:47:41.369000Z</published><updated>2020-02-27T13:47:41.369000Z</updated><author><name>Ralph Holz</name><uri>https://forge.codesys.com/u/ralph-holz/</uri></author><id>https://forge.codesys.com64f685c25b0a37c0244781d3dcf7edaa2c6be743</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Aurelien,&lt;/p&gt;
&lt;p&gt;thats just a guess but maybee it helps:&lt;/p&gt;
&lt;p&gt;Try the ETC_CO_SEGMENTED mode maybee this helps&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Ralph&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CoDeSys v3 and EtherCat : library ETC_CO_SdoWrite</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7d8cc7fc9e/?limit=25#abcb" rel="alternate"/><published>2020-02-27T13:47:41.330000Z</published><updated>2020-02-27T13:47:41.330000Z</updated><author><name>aurelien</name><uri>https://forge.codesys.com/u/aurelien/</uri></author><id>https://forge.codesys.come501c163bfbd38f63e9ff1fafee26c0ec6a65da9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi everybody,&lt;/p&gt;
&lt;p&gt;I'm tring to use Codesys v3 with a CoE device.&lt;/p&gt;
&lt;p&gt;And with the library ETC_CO_SdoWrite, I want to send some SDOs.&lt;/p&gt;
&lt;p&gt;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" .&lt;/p&gt;
&lt;p&gt;What I made wrong ?&lt;/p&gt;
&lt;p&gt;thank you in advance&lt;/p&gt;
&lt;p&gt;in the following, my function ETC_CO_SdoWrite and a capture of what is sent :&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Bild" rel="nofollow" src="http://img84.imageshack.us/img84/4407/sanstitreiz.jpg"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>