<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=us-ascii">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle23
{mso-style-type:personal-compose;
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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Gavin,<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">I’ve added some <span style="color:#4472C4">
comments </span>to your email below.<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">In summary though:<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 lang="EN-US">> I could perhaps understand a patch to instead only read register 0x0012 if<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> the ESI alias is zero (and trust the ESI alias otherwise), to perhaps allow<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> changing the alias without rebooting.<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" style="color:#4472C4">Actually this is exactly what the patch is doing.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Graeme.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="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><span lang="EN-US">From:</span></b><span lang="EN-US"> Gavin Lambert <gavin.lambert@tomra.com>
<br>
<b>Sent:</b> Tuesday, 13 December 2022 14:34<br>
<b>To:</b> Graeme Foot <Graeme.Foot@touchcut.com>; etherlab-users@etherlab.org<br>
<b>Subject:</b> RE: Patch for --enable-regalias<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">> I’m not sure this makes sense.<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">> Register 0x0012 is typically used for slave identification for slaves that<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> have hardware switches of some kind to specify the desired alias. In almost<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> all cases, these will have an SII alias of zero; as such it would be<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> counterproductive to skip reading them in that case. It is usually required<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> to reboot the slave to change its id switch. (See “Explicit Device<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> Identification” in ETG1020 for more info.)<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" style="color:#4472C4">Yes, if you have a slave that requires reading register 0x0012 then the SII<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">alias value will be zero. This patch will read 0x0012 if the SII alias is zero, but<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">if it is non-zero it will continue on to reading the 0x0012 register. Also if the<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">SII alias is non-zero then it should match the 0x0012 value, so reading 0x0012<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">is not required and can be skipped.<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">> In the absence of devices that use such a hardware id selector, you should<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> avoid using the –enable-regalias configuration option for improved scan<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> performance.<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" style="color:#4472C4">Agreed. Unfortunately we now have a slave that requires it. This patch<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">Is only improving –enable-regalias, should it be enabled.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">This patch will also improve scan performance of –enable-regalias by<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">skipping reading register 0x0012 if the slave has an non-zero SII slave alias.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">Also if you do not use slave aliases in your system then you are unlikely to<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">Require –enable-regalias for this type of slave anyway.<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">> For master-based changing of the alias (e.g. via the “ethercat alias”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> command), rebooting the slave is still required and (unless the slave<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> implementation has chosen otherwise) will also be reflected in register<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> 0x0012, so this will work regardless of whether –enable-regalias is enabled<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> or not.<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" style="color:#4472C4">The “ethercat alias” command works by writing the first 8 words into the<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">slaves SII. It then also updates its in memory slave->effective_alias value.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">The updated SII with the new alias is available for reading immediately and<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">does not require the slave to be rebooted. (However you are correct that<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">it does need to be rebooted/reset for the 0x0012 register to be updated.)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">Once the master has identified a slave by its alias it is assigned a station<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">address and all further EtherCAT commands then use that station address<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">(avoiding commands that use alias addressing).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">So if you assign a slaves alias using the “ethercat alias” command (which<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">you would not use on slaves with dials/dipswitches) then this patch allows<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">the master to be rebooted without the slave needing to be rebooted<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">(which can easily occur if you have remote IO that is powered separately).<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">> I could perhaps understand a patch to instead only read register 0x0012 if<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> the ESI alias is zero (and trust the ESI alias otherwise), to perhaps allow<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> changing the alias without rebooting.<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" style="color:#4472C4">Actually this is exactly what the patch is doing.<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">> However the documentation is fairly clear that the reboot is not optional.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> Etherlab does bypass some of this requirement by only using the station<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> address (not the alias) on the wire, thus making it appear as if the device<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> is answering to an alias change without a reboot, but it’s best not to rely<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> on this sort of implementation detail.<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" style="color:#4472C4">Avoiding the need to repower a slave after setting its alias helps with machine<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">commissioning as setting slave aliases is usually one of multiple steps. If you<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">reboot the master at a later stage (without rebooting the slaves) it looks like<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">the slaves have mysteriously lost their aliases. This patch avoids that.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">Yes, the entire system should be repowered and proved after setting aliases<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4">but that can happen once all of the configuration is complete.<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">> (A slave may also choose to implement CoE object 0x10E0, which allows updating<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> 0x0012 without a reboot, but this is not mandatory.)<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" style="color:#4472C4">Good to know, but it is not implemented by the slave we are using.<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">> Gavin Lambert<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">> Senior Software Developer TOMRA Fresh Food</span><span lang="EN-US" style="color:#231F20"><br>
</span><span lang="EN-US"><br>
<br>
<img width="192" height="45" style="width:2.0in;height:.4687in" id="Picture_x0020_1" src="cid:image001.png@01D90F9C.33EE9990"> <o:p></o:p></span></p>
<p style="margin-top:0cm"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><img width="600" height="151" style="width:6.25in;height:1.5729in" id="Picture_x0020_2" src="cid:image002.jpg@01D90F9C.33EE9990"></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span><a href="https://www.facebook.com/TOMRA.Food/" target="_blank"><span lang="EN-US" style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_3" src="cid:image003.jpg@01D90F9C.33EE9990" alt="tomra facebook"></span></a><span lang="EN-US"> </span><a href="https://www.linkedin.com/company/tomra-food/" target="_blank"><span lang="EN-US" style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_4" src="cid:image004.jpg@01D90F9C.33EE9990" alt="tomra linkedin"></span></a><span lang="EN-US"> </span><a href="https://twitter.com/TOMRAFood" target="_blank"><span lang="EN-US" style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_5" src="cid:image005.jpg@01D90F9C.33EE9990" alt="tomra twitter"></span></a><span lang="EN-US"> </span><a href="https://www.youtube.com/playlist?list=PLDD3B1A7BAE919EC6" target="_blank"><span lang="EN-US" style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_6" src="cid:image006.jpg@01D90F9C.33EE9990" alt="tomra youtube"></span></a><span lang="EN-US"> </span><a href="https://www.instagram.com/tomrafood/" target="_blank"><span lang="EN-US" style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_7" src="cid:image007.jpg@01D90F9C.33EE9990" alt="tomra instragram"></span></a><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:8.5pt;color:#6E8186"> <b>Compac Technologies Ltd</b> | 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | New Zealand
</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.5pt;color:#6E8186"> Phone: +64 96 34 00 88 |
<a href="https://www.compacsort.com">https://www.compacsort.com</a></span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:6.5pt;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"><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"> Graeme Foot<br>
<b>Sent:</b> Tuesday, 13 December 2022 14:05<br>
<b>To:</b> <a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> [Etherlab-users] Patch for --enable-regalias<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have attached a patch for the --enable-regalias option.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--enable-regalias enables reading slave aliases from register 0x0012. When enabled all slaves read 0x0012, replacing any alias value read from the SII. However, if you set a new alias on a slave (with the “ethercat alias” function) the
0x0012 register is not updated (and is readonly to the master so can’t be). This requires the slave to be repowered/restarted for the register to update. So if you restart the master without repowering/restarting the slave, the master will read the old alias
from the 0x0012 register.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The patch will now only read register 0x0012 if the SII alias is non-zero. This slightly shortens the slave scan for most slaves (that have aliases) and allows the master to use the correct alias on restart. However, if you are resetting
the alias (setting it to zero) the slave will still require a repower/reset.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Note you shouldn’t be setting aliases via the “ethercat alias” function on slaves with dials/dipswitches, or slaves that only support 0x0012 (and not SII aliases), so we can ignore any issues these slaves could have.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The patch is based on mercurial revision 2679 (33b922ec1871) and the gavinl patchset 20171108.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Graeme Foot.<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>