<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Webdings;
panose-1:5 3 1 2 1 5 9 6 7 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
pre
{mso-style-priority:99;
mso-style-link:"Préformaté HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.PrformatHTMLCar
{mso-style-name:"Préformaté HTML Car";
mso-style-priority:99;
mso-style-link:"Préformaté HTML";
font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.HTMLPreformatted, li.HTMLPreformatted, div.HTMLPreformatted
{mso-style-name:"HTML Preformatted";
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle26
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:993601919;
mso-list-type:hybrid;
mso-list-template-ids:-558066252 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:1196767464;
mso-list-template-ids:-1451749198;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">Thank you Gavin,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">It is entirely clear to me now.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:#1F497D">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">Vincent BUSSIERES<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Responsable Technique Logiciel<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="color:black"><img width="96" height="72" style="width:1.0in;height:.75in" id="Image_x0020_1" src="cid:image001.png@01D7CA4D.A92425D0" alt="1572337113342"><o:p></o:p></span></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#00295C">ZE Ma Campagne<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#00295C">36, Impasse Félix Nadar<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#00295C">16000 ANGOULEME<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:gray">Tel: 33 (0)9.72.40.36.52<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#999999"><a href="https://webmail.nexeya.fr/owa/redir.aspx?C=GK_BqKCZef7LtPZnqnd_LGYr1NG9sz4Smy3iKIwO-pXqtJC7VgzXCA..&URL=http%3a%2f%2fwww.hemeria-group.com%2f" target="_blank">www.hemeria-group.com</a></span></i><span style="color:black"> <br>
</span><span style="font-size:16.0pt;font-family:Webdings;color:green">P</span><span style="color:black"> </span><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:#99CC00">Afin de contribuer au respect de l'environnement, merci de n'imprimer
ce courriel qu'en cas de nécessité.</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:gray">Ce message et les fichiers pouvant être attachés sont confidentiels, réservés à l'usage unique des destinataires et n'engagent HEMERIA sous aucune forme que ce soit.</span><span style="color:black"><br>
</span><span lang="EN-GB" style="font-size:8.0pt;font-family:"Verdana",sans-serif;color:gray">This email and any files transmitted with it are confidential, intented solely for the unique use of the recipients and don't commit HEMERIA.</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;color:black"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D"><o:p> </o:p></span></b></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>De :</b> Gavin Lambert <gavin.lambert@tomra.com> <br>
<b>Envoyé :</b> mardi 26 octobre 2021 00:00<br>
<b>À :</b> BUSSIERES Vincent <vincent.bussieres@hemeria-group.com>; etherlab-users@etherlab.org<br>
<b>Objet :</b> RE: ecrt_sdo_request_state : error<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">No, in fact you <b>must not</b> call ecrt_sdo_request_write on each cycle; you must call it only to begin a write.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The proper sequence is:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span lang="EN-US">Call ecrt_sdo_request_index[_complete] to set the SDO to write (not required if this is the same SDO as the previous request / when created).<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span lang="EN-US">Call ecrt_sdo_request_data and write the data value to be written by the request into this buffer.<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span lang="EN-US">Call ecrt_sdo_request_write[_with_size] to begin the write request.<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span lang="EN-US">Each subsequent cycle, call ecrt_sdo_request_state to check the progress – do not call any of the above again on the same object while the status is EC_REQUEST_BUSY.<o:p></o:p></span></li><li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span lang="EN-US">After completion, you may stop calling ecrt_sdo_request_state (although it’s harmless if you continue), and you may start over at #1 again on any subsequent cycle.<o:p></o:p></span></li></ol>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#1-3 happen in the same cycle. You don’t have to do #4 on
<i>every</i> cycle, but you must not try to use the request object again in any other way until the request is completed (with success or error). You
<i>can</i> have multiple request objects active for a single slave at a time, but bear in mind that they will happen in series, not parallel. (Multiple requests for different slaves will happen in parallel, although only up to a preset concurrency limit.)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Since this is asynchronous functionality, you may find it useful to implement it with a state machine, although this is not required.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:12.0pt;font-family:"Calibri",sans-serif;color:#231F20">Gavin Lambert</span></strong><b><span lang="EN-US" style="font-size:12.0pt;color:#231F20"><br>
</span></b><span lang="EN-US" style="font-size:12.0pt;color:#231F20"> <br>
Senior Software Developer TOMRA Fresh Food<br>
<br>
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
<br>
<img border="0" width="350" height="45" style="width:3.65in;height:.4666in" id="_x0000_i1025" src="cid:image002.png@01D7CA4D.A92425D0"> <br>
<a href="https://www.facebook.com/TOMRAFreshFood" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3166in;height:.3166in" id="_x0000_i1026" src="cid:image003.jpg@01D7CA4D.A92425D0" alt="tomra facebook"></span></a> <a href="https://www.linkedin.com/company/tomra-fresh-food/" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3166in;height:.3166in" id="_x0000_i1027" src="cid:image004.jpg@01D7CA4D.A92425D0" alt="tomra linkedin"></span></a> <a href="https://vimeo.com/tomrafreshfood" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3166in;height:.3166in" id="_x0000_i1028" src="cid:image005.jpg@01D7CA4D.A92425D0" alt="tomra vimeo"></span></a> <a href="https://www.instagram.com/tomrafood/" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3166in;height:.3166in" id="_x0000_i1029" src="cid:image006.jpg@01D7CA4D.A92425D0" alt="tomra instragram"></span></a><br>
</span><span lang="EN-US" style="font-size:9.0pt;color:#6E8186"> <b>Compac Technologies Ltd</b> | 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | New Zealand
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;color:#6E8186"> Phone: +64 96 34 00 88 |
<a href="https://www.compacsort.com">https://www.compacsort.com</a></span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
</span><span lang="EN-US" style="font-size:7.0pt;color:#6E8186">The information contained in this communication and any attachment is confidential and may be legally privileged. It should only be read by the person(s) to whom it is addressed. If you have received
this communication in error, please notify the sender and delete the communication.
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> BUSSIERES Vincent<br>
<b>Sent:</b> Monday, 25 October 2021 08:55<br>
<b>To:</b> <a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> [Etherlab-users] ecrt_sdo_request_state : error<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div id="divtagdefaultwrapper">
<div>
<pre><span lang="EN-US" style="color:black">Dear Etherlab users,<br><br>I use a Beckhoff module EL5102 (2 channels encoder interface) and two servodrives to control motors.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">I develop a homing sequence as below :<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">1- Enable counter reset on channel 1 when index encoder is encountered<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">2- Move axis 1 until index is encoutered<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">3- Unable counter reset on channel 1 <o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">4- Enable counter reset on channel 2 when index encoder is encountered<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">5- Move axis 2 until index is encoutered<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">6- Unable counter reset on channel 2<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">Unabling and disabling counter reset is done using SDOs 0x80n0:01 where n is the channel number.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">In my program, I create 2 SDO requests with « ecrt_slave_config_create_sdo_request » before changing master state in OP with « ecrt_master_activate ».<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">Then, before entering in cyclic task, I write SDOs for the first time and I get « EC_REQUEST_UNUSED » SDO request state (trigger first write), it seems to be OK.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black">void enableIndexResetCh_n(state)</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black">{</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> switch (ecrt_sdo_request_state(mReqIndexResetCh_n)) {</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> case EC_REQUEST_UNUSED: </span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> ecrt_sdo_request_write(mReqIndexResetCh_n); </span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> break;</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> </span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> case EC_REQUEST_BUSY:</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> break;</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> case EC_REQUEST_SUCCESS:</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> EC_WRITE_U8(ecrt_sdo_request_data(mReqIndexResetCh1), static_cast<uint8_t>(state));</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> ecrt_sdo_request_write(mReqIndexResetCh_n); </span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> break;</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> default:</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> ecrt_sdo_request_write(mReqIndexResetCh_n);</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> break;</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> }</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black"> break;</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-size:8.0pt;color:black">}</span><span lang="EN-US" style="color:black"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">Then, I realize homing sequence in the cyclic task as described before.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">For the fisrt channel, I write « 1 » into SDO 0x8000:01, request state is « EC_REQUEST_SUCCES » but for the second channel 0x8010:02 I get « EC_REQUEST_ERROR » and SDO value remains at false state.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">I don’t understand why I get this error.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">Moreover I want to let you know that I don’t call « ecrt_sdo_request_write » at each loop of cyclic task but only when I need to change sdo state. Perhaps this is not the right way to call this function. Do I have to call this function at each iteration ?<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">How can I be sure that sdo state corresponds to the right state ? Do I have to read sdo state (if sdo is R/W) also at each iteration ?<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p> </o:p></span></pre>
<pre><span lang="EN-US" style="color:black">Regards<o:p></o:p></span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>