<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@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;}
/* 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:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
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:11.0pt;
font-family:"Calibri",sans-serif;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.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;}
--></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="EN-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">No, you should never need to run downloads via a script.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">As I said, you do the downloads once manually and then get the cstruct output, and put that into your application code. After this, simply starting your application and activating the master should
automatically do the same configuration just prior to switching to SAFEOP – you don’t need to have
<b>any</b> explicit SDO download code in your app; you only have the </span>ecrt_domain_reg_pdo_entry_list().<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">You can use “ethercat debug 1”, start up your application, and then observe the syslog to see that it will automatically configure the 0x1C12 and 0x1C13 registers with just that. If things still aren’t working then this might also give
you some additional hints.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As for “protocol not supported”, I’m not really sure. What’s the output of “ethercat slaves -v” on that specific slave?<i><span style="mso-fareast-language:EN-US"><o:p></o:p></span></i></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><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"> Derrill Vezina [mailto:vezinadj@gmail.com]
<br>
<b>Sent:</b> Saturday, 7 July 2018 06:34<br>
<b>To:</b> Gavin Lambert <gavin.lambert@tomra.com><br>
<b>Cc:</b> Derrill Vezina <dvezina@caroneng.com>; etherlab-users@etherlab.org<br>
<b>Subject:</b> Re: [etherlab-users] Failed to execute SDO download: Protocol not supported<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">The problem is that the downloads are not persistent and the PDO / Sync registers do not hold on power cycle…so the downloads need to happen every time on boot. Is it common practice to run the SDO downloads using the tool using a script
on startup?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Going back to my original question, what is the difference is between running the etherlab tool to download SDO’s in which im <b><i>not</i></b> getting the “Protocol not supported” error (which I have done and it re-assigns the PDO entries
correctly which changes the output of the cstruct to match the Rev25 and below), and trying to do it from my software using the application library using ecrt_master_sdo_download() (pre-cyclic task / ecrt_domain_reg_pdo_entry_list()) which essentially uses
the same code using the ioctl interface which is where I'm getting the “Protocol not supported” error?<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jul 5, 2018, at 7:30 PM, Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Ok. So after you do that and rescan, check the output of “ethercat cstruct”. This should have changed to reflect the new configuration of the assignment registers (assuming that the slave actually did accept the downloads), and this is
the data that you need to include in your application code<span class="apple-converted-space"> </span><i>instead of</i><span class="apple-converted-space"> </span>trying to explicitly write to the assignment registers. (Using the correct sequence in<span class="apple-converted-space"> </span><span lang="EN-US">ecrt_domain_reg_pdo_entry_list
makes Etherlab do those same downloads internally during configuration.)</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<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">
<div>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span class="apple-converted-space"><span lang="EN-US"> </span></span><span lang="EN-US">Derrill Vezina [<a href="mailto:dvezina@caroneng.com">mailto:dvezina@caroneng.com</a>]<span class="apple-converted-space"> </span><br>
<b>Sent:</b><span class="apple-converted-space"> </span>Friday, 6 July 2018 02:03<br>
<b>To:</b><span class="apple-converted-space"> </span>Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>>; Derrill Vezina <<a href="mailto:vezinadj@gmail.com">vezinadj@gmail.com</a>>;
<a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b><span class="apple-converted-space"> </span>Re: [etherlab-users] Failed to execute SDO download: Protocol not supported</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi Gavin.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I fully understand that this is a Beckhoff / integration issue and not anything to do with the master. I have been doing as you instructed and it has worked with different revisions with different PDO structures with
a bunch of different cards up until this specific situation. Without getting too in depth with it, Beckhoff allowed setting two PDO’s originally including the period and duty cycle of the PWM wave output on the EL2502 for each channel. They decided on REV25+
that they were going to remove the period as a PDO and use it as an SDO. To fix this, Beckhoff has instructed a sequence of setting some startup SDO configuration registers that would set the PDO assignment back to the “old way” in which I have successfully
done using the Etherlab tool using the following commands (only one card on the stack after starting the master):</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">./ethercat download --position 1 --type uint16 0x1C12 0x00 0x00</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">./ethercat download --position 1 --type uint8 0x1C13 0x00 0x00</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">./ethercat download --position 1 --type uint16 0x1C12 0x01 0x1602</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">./ethercat download --position 1 --type uint16 0x1C12 0x02 0x1603</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">./ethercat download --position 1 --type uint16 0x1C12 0x00 0x02</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">./ethercat rescan</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Everything works great after that sequence.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I guess my confusion lies in the fact that the tool successfully downloads the PDO’s using the ioctl interface without getting a “Protocol not supported” error. Is there a reason why I would get a “Protocol not supported”
error using the application interface library to do this (ecrt_master_sdo_download()) but not using the tool? Is the master state the problem?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt">From:<span class="apple-converted-space"> </span></span></b><span lang="EN-US" style="font-size:12.0pt">etherlab-users <<a href="mailto:etherlab-users-bounces@etherlab.org"><span style="color:#954F72">etherlab-users-bounces@etherlab.org</span></a>>
on behalf of Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com"><span style="color:#954F72">gavin.lambert@tomra.com</span></a>><br>
<b>Date:<span class="apple-converted-space"> </span></b>Thursday, June 28, 2018 at 7:45 PM<br>
<b>To:<span class="apple-converted-space"> </span></b>Derrill Vezina <<a href="mailto:vezinadj@gmail.com"><span style="color:#954F72">vezinadj@gmail.com</span></a>>, "<a href="mailto:etherlab-users@etherlab.org"><span style="color:#954F72">etherlab-users@etherlab.org</span></a>"
<<a href="mailto:etherlab-users@etherlab.org"><span style="color:#954F72">etherlab-users@etherlab.org</span></a>><br>
<b>Subject:<span class="apple-converted-space"> </span></b>Re: [etherlab-users] Failed to execute SDO download: Protocol not supported</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">You don’t need to perform explicit downloads of the PDO assignment or configuration registers at all, ever; they are managed internally by the master library. Simply use the combination of ecrt_slave_config_pdos and
ecrt_domain_reg_pdo_entry_list as shown in the examples. You can use “ethercat cstruct” to generate the required data structures for these calls. (In some cases or for particular slaves, eg. with overlapping or repeated PDOs, you might need to do something
a little more complicated, but that is rare.)</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">If you have slaves with different revisions, note that different structures may be required for each revision, if the PDO layout has been changed.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">If the slave does not support CoE (which is what the “protocol not supported” error implies) then it is not possible to alter the slave’s PDO assignment – it has a manufacturer-defined fixed setup. You must make sure
that the configuration and assignment defined in your application matches this, by using those APIs mentioned above.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<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">
<div>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span class="apple-converted-space"><span lang="EN-US"> </span></span><span lang="EN-US">Derrill Vezina<br>
<b>Sent:</b><span class="apple-converted-space"> </span>Friday, 29 June 2018 01:40<br>
<b>To:</b><span class="apple-converted-space"> </span><a href="mailto:etherlab-users@etherlab.org"><span style="color:#954F72">etherlab-users@etherlab.org</span></a><br>
<b>Subject:</b><span class="apple-converted-space"> </span>[etherlab-users] Failed to execute SDO download: Protocol not supported</span><o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi,</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt"> </span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">I am currently using a Beckhoff EL2502 PWM output card with the Etherlab 1.5.2 master using the generic ethernet driver. On startup, I am trying to set a PDO assignment SDO register using ecrt_master_sdo_download() and
am getting an error back “Failed to execute SDO download: Protocol not supported”.</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">I am not able to set a PDO assignment SDO registers using the ecrt_slave_config_sdoX() calls…which from my reading of other mailing list posts is only used for configuration registers.</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">In turn, I was able to use the Ethercat Etherlab tool and change the PDO mapping so I assumed it is available from the application interface since they use the same calls (ioctl interface)</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Beckhoff changed the firmware on the card and I’m trying to reassign the PDO’s to the old mappings… this isn’t the first time I’ve run into this problem so I'm looking for a solution for all cards that would have this
problem. Ideally, id like to do it through the application interface and avoid running a script on startup that uses the tool.</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Has anyone has success with doing this type of transaction?</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">_______________________________________________<br>
etherlab-users mailing list<br>
</span><a href="mailto:etherlab-users@etherlab.org"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#954F72">etherlab-users@etherlab.org</span></a><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
</span><a href="https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.etherlab.org%2Fmailman%2Flistinfo%2Fetherlab-users&data=02%7C01%7Cgavin.lambert%40tomra.com%7C941b8c1cacc944700e1c08d5e36f1275%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C636664988557935341&sdata=R15pFMQz%2Fvo2wO%2FjzEvYvdKCXooKiRQ2QWVJ4FCqIqk%3D&reserved=0"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif;color:#954F72">http://lists.etherlab.org/mailman/listinfo/etherlab-users</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>