<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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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.EmailStyle22
{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-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Ok, that makes more sense. Although just to avoid repeating the condition I would have written that more like this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:Consolas">#ifdef EC_REGALIAS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> if (slave->effective_alias == 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> ec_fsm_slave_scan_enter_regalias(fsm, datagram);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> } else<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> if (slave->sii_image->sii.mailbox_protocols & EC_MBOX_COE) {<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<span style="FONT-FAMILY: Gotham, Calibri, 'sans-serif'; COLOR: #231f20"><strong>Gavin Lambert<br></strong>
<br>
Senior Software Developer TOMRA Fresh Food<br>
<br>
</span><br>
<br><img style="HEIGHT: 45px; WIDTH: 192px" src="cid:TOMRA_CMYK_final_size_times_two_cd761a01-1d1f-446e-9316-8012271820b6.png" width="192" height="45" border="0">
<br>
<P
style="FONT-SIZE: 10pt; MARGIN-BOTTOM: 5pt; FONT-FAMILY: Arial; MARGIN-TOP: 0px"><IMG
border=0
src="cid:TOMRA_50th-Email_Signature_Food-08_ba63a226-17be-4b94-80e3-3f48ae3d72b3.jpg"></P> <A href="https://www.facebook.com/TOMRA.Food/" target=_blank><IMG
alt="tomra facebook" src="cid:TF-FB-icon_b77c57e4-4990-4f9d-b3a2-8e6ab45df7f2.jpg"
height=30></A> <A href="https://www.linkedin.com/company/tomra-food/"
target=_blank><IMG alt="tomra linkedin"
src="cid:TF-LinkedIn-icon_d54c4829-dcb9-450c-9187-34b26e85ebaa.jpg"
height=30></A> <A href="https://twitter.com/TOMRAFood" target=_blank><IMG
alt="tomra twitter"
src="cid:TF-twitter-icon_65c62d2e-772c-4a2c-97c5-d84fbfc204d5.jpg"
height=30></A> <A
href="https://www.youtube.com/playlist?list=PLDD3B1A7BAE919EC6"
target=_blank><IMG alt="tomra youtube"
src="cid:TF-Youtube-icon_8b2c830c-70d9-48da-a4db-db9191d346ba.jpg"
height=30></A> <A href="https://www.instagram.com/tomrafood/"
target=_blank><IMG alt="tomra instragram"
src="cid:TOMRAinstagram_45b30c55-490a-4f32-8fd3-998c152e3494.jpg"
height=30></A><BR><span style="FONT-SIZE: 75%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: #6e8186"> <b>Compac Technologies Ltd</b>
| 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | New Zealand </span><br>
<p style="FONT-SIZE: 10pt; MARGIN-BOTTOM: 5pt; FONT-FAMILY: Arial; MARGIN-TOP: 0px"></p>
<span style="FONT-SIZE: 75%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: #6e8186"> Phone: +64 96 34 00 88 | <a href="https://www.compacsort.com">https://www.compacsort.com</a></span><br>
<span style="FONT-SIZE: 60%; FONT-FAMILY: Gotham, Calibri, 'sans-serif'; 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><br>
<span style="FONT-SIZE: 60%; FONT-FAMILY: Gotham, Calibri, 'sans-serif'; WIDTH: 75%; COLOR: #6e8186">
</span><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>From:</b> Graeme Foot <Graeme.Foot@touchcut.com> <br>
<b>Sent:</b> Wednesday, 14 December 2022 11:55<br>
<b>To:</b> Gavin Lambert <gavin.lambert@tomra.com>; etherlab-users@etherlab.org<br>
<b>Subject:</b> RE: Patch for --enable-regalias<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ">Yip, I stuffed up that first paragraph. I blame covid brain. What I meant to say was:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">This patch will read 0x0012 if the SII alias is zero, but<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">if it is non-zero it will continue on to
<span style="background:yellow;mso-highlight:yellow">entering the slave into PREOP</span><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">The patch says it all:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New"">diff --git a/master/fsm_slave_scan.c b/master/fsm_slave_scan.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:yellow;mso-highlight:yellow">--- a/master/fsm_slave_scan.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:yellow;mso-highlight:yellow">+++ b/master/fsm_slave_scan.c</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";color:red">@@ -589,14 +589,16 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> // The SII image data is already available and we can enter PREOP<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New"">#ifdef EC_REGALIAS<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:red;mso-highlight:red">- ec_fsm_slave_scan_enter_regalias(fsm, datagram);</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+ if (slave->effective_alias == 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+ ec_fsm_slave_scan_enter_regalias(fsm, datagram);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+ } else if (slave->sii_image->sii.mailbox_protocols & EC_MBOX_COE) {</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New"">#else<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> if (slave->sii_image->sii.mailbox_protocols & EC_MBOX_COE) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+#endif</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> ec_fsm_slave_scan_enter_preop(fsm, datagram);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> } else {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> fsm->state = ec_fsm_slave_scan_state_end;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:red;mso-highlight:red">-#endif</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> else<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New"">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";color:red">@@ -1384,14 +1386,16 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> #ifdef EC_REGALIAS<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:red;mso-highlight:red">- ec_fsm_slave_scan_enter_regalias(fsm, datagram);</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+ if (slave->effective_alias == 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+ ec_fsm_slave_scan_enter_regalias(fsm, datagram);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+ } else if (slave->sii_image->sii.mailbox_protocols & EC_MBOX_COE) {</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New"">#else<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> if (slave->sii_image->sii.mailbox_protocols & EC_MBOX_COE) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:lime;mso-highlight:lime">+#endif</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> ec_fsm_slave_scan_enter_preop(fsm, datagram);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> } else {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> fsm->state = ec_fsm_slave_scan_state_end;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New";background:red;mso-highlight:red">-#endif</span><span lang="EN-NZ" style="font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> return;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ" style="font-family:"Courier New""> end:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">Graeme.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><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>From:</b> Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>>
<br>
<b>Sent:</b> Wednesday, 14 December 2022 11:16<br>
<b>To:</b> Graeme Foot <<a href="mailto:Graeme.Foot@touchcut.com">Graeme.Foot@touchcut.com</a>>;
<a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> RE: Patch for --enable-regalias<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal">You’re using very confusing wording, which makes it hard to understand. Admittedly I haven’t reviewed the patch itself as yet.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span 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 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 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 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 style="color:#4472C4">is not required and can be skipped.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So it reads 0x0012 if the alias is zero, or it reads 0x0012 if the alias is non-zero, although it isn’t required? This appears to be some strange usage of the word “non-zero” that I wasn’t previously aware of…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#4472C4">This patch will also improve scan performance of –enable-regalias by<o:p></o:p></span></p>
<p class="MsoNormal"><span 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 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 style="color:#4472C4">Require –enable-regalias for this type of slave anyway.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is a bit clearer, but it’s different from what you said in your original post.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><strong><span style="font-family:"Calibri",sans-serif;color:#231F20">Gavin Lambert</span></strong><b><span style="color:#231F20"><br>
</span></b><span style="color:#231F20"> <br>
Senior Software Developer TOMRA Fresh Food<br>
<br>
</span><br>
<br>
<img border="0" width="192" height="45" style="width:2.0in;height:.4687in" id="_x0000_i1038" src="cid:image001.png@01D90FB3.9BD63650"> <o:p></o:p></p>
<p style="margin-top:0cm"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><img border="0" width="600" height="151" style="width:6.25in;height:1.5729in" id="_x0000_i1037" src="cid:image002.jpg@01D90FB3.9BD63650"></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FTOMRA.Food%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LQQCE8pOSeajbnisTc2RJZARrlZ7iXBObo4B3PCJ7ho%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="_x0000_i1036" src="cid:image003.jpg@01D90FB3.9BD63650" alt="tomra facebook"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Ftomra-food%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Sd0bD%2BNJ8zz0aDGkMOfvqaoNDyfBuxYGOa2k5ckgQGk%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="_x0000_i1035" src="cid:image004.jpg@01D90FB3.9BD63650" alt="tomra linkedin"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTOMRAFood&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IqIH07Pn39lD9YS957Y%2B9BFr%2Fl%2BhycEGLKmwpZp%2Fyp0%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="_x0000_i1034" src="cid:image005.jpg@01D90FB3.9BD63650" alt="tomra twitter"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLDD3B1A7BAE919EC6&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=X3VwlMQLhNHkwCVDc5%2BVeDxV6ghoIzPYdcLZNkQePjI%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="_x0000_i1033" src="cid:image006.jpg@01D90FB3.9BD63650" alt="tomra youtube"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Ftomrafood%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0DbSkk8gtYG6V6bpkBZuWdUar3ygNghYNVD0ZCvL%2Bxc%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="_x0000_i1032" src="cid:image007.jpg@01D90FB3.9BD63650" alt="tomra instragram"></span></a><br>
<span style="font-size:8.5pt;color:#6E8186"> <b>Compac Technologies Ltd</b> | 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | New Zealand
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:8.5pt;color:#6E8186"> Phone: +64 96 34 00 88 |
<a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.compacsort.com%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=clkbQzDFr9RYU14S6RSPUqAae2AfDeFqaqHvxRuqNVk%3D&reserved=0">
https://www.compacsort.com</a></span><br>
<span 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><o:p></o:p></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>From:</b> Graeme Foot <<a href="mailto:Graeme.Foot@touchcut.com">Graeme.Foot@touchcut.com</a>>
<br>
<b>Sent:</b> Wednesday, 14 December 2022 10:19<br>
<b>To:</b> Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>>;
<a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> RE: Patch for --enable-regalias<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ">Hi Gavin,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">I’ve added some <span style="color:#4472C4">
comments </span>to your email below.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">In summary though:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal">> I could perhaps understand a patch to instead only read register 0x0012 if<o:p></o:p></p>
<p class="MsoNormal">> the ESI alias is zero (and trust the ESI alias otherwise), to perhaps allow<o:p></o:p></p>
<p class="MsoNormal">> changing the alias without rebooting.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#4472C4">Actually this is exactly what the patch is doing.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-NZ">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">Graeme.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><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>From:</b> Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>>
<br>
<b>Sent:</b> Tuesday, 13 December 2022 14:34<br>
<b>To:</b> Graeme Foot <<a href="mailto:Graeme.Foot@touchcut.com">Graeme.Foot@touchcut.com</a>>;
<a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> RE: Patch for --enable-regalias<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal">> I’m not sure this makes sense.<o:p></o:p></p>
<p class="MsoNormal">> <o:p></o:p></p>
<p class="MsoNormal">> Register 0x0012 is typically used for slave identification for slaves that<o:p></o:p></p>
<p class="MsoNormal">> have hardware switches of some kind to specify the desired alias. In almost<o:p></o:p></p>
<p class="MsoNormal">> all cases, these will have an SII alias of zero; as such it would be<o:p></o:p></p>
<p class="MsoNormal">> counterproductive to skip reading them in that case. It is usually required<o:p></o:p></p>
<p class="MsoNormal">> to reboot the slave to change its id switch. (See “Explicit Device<o:p></o:p></p>
<p class="MsoNormal">> Identification” in ETG1020 for more info.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span 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 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 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 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 style="color:#4472C4">is not required and can be skipped.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> In the absence of devices that use such a hardware id selector, you should<o:p></o:p></p>
<p class="MsoNormal">> avoid using the –enable-regalias configuration option for improved scan<o:p></o:p></p>
<p class="MsoNormal">> performance.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span 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 style="color:#4472C4">Is only improving –enable-regalias, should it be enabled.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">This patch will also improve scan performance of –enable-regalias by<o:p></o:p></span></p>
<p class="MsoNormal"><span 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 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 style="color:#4472C4">Require –enable-regalias for this type of slave anyway.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> For master-based changing of the alias (e.g. via the “ethercat alias”<o:p></o:p></p>
<p class="MsoNormal">> command), rebooting the slave is still required and (unless the slave<o:p></o:p></p>
<p class="MsoNormal">> implementation has chosen otherwise) will also be reflected in register<o:p></o:p></p>
<p class="MsoNormal">> 0x0012, so this will work regardless of whether –enable-regalias is enabled<o:p></o:p></p>
<p class="MsoNormal">> or not.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span 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 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 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 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 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 style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span 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 style="color:#4472C4">address and all further EtherCAT commands then use that station address<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">(avoiding commands that use alias addressing).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span 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 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 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 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"><o:p> </o:p></p>
<p class="MsoNormal">> I could perhaps understand a patch to instead only read register 0x0012 if<o:p></o:p></p>
<p class="MsoNormal">> the ESI alias is zero (and trust the ESI alias otherwise), to perhaps allow<o:p></o:p></p>
<p class="MsoNormal">> changing the alias without rebooting.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#4472C4">Actually this is exactly what the patch is doing.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> However the documentation is fairly clear that the reboot is not optional.<o:p></o:p></p>
<p class="MsoNormal">> Etherlab does bypass some of this requirement by only using the station<o:p></o:p></p>
<p class="MsoNormal">> address (not the alias) on the wire, thus making it appear as if the device<o:p></o:p></p>
<p class="MsoNormal">> is answering to an alias change without a reboot, but it’s best not to rely<o:p></o:p></p>
<p class="MsoNormal">> on this sort of implementation detail.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span 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 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 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 style="color:#4472C4">the slaves have mysteriously lost their aliases. This patch avoids that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4"><o:p> </o:p></span></p>
<p class="MsoNormal"><span 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 style="color:#4472C4">but that can happen once all of the configuration is complete.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> (A slave may also choose to implement CoE object 0x10E0, which allows updating<o:p></o:p></p>
<p class="MsoNormal">> 0x0012 without a reboot, but this is not mandatory.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span 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"><o:p> </o:p></p>
<p class="MsoNormal">> Gavin Lambert<o:p></o:p></p>
<p class="MsoNormal">> <o:p></o:p></p>
<p class="MsoNormal">> Senior Software Developer TOMRA Fresh Food<span style="color:#231F20"><br>
</span><br>
<br>
<img border="0" width="192" height="45" style="width:2.0in;height:.4687in" id="Picture_x0020_1" src="cid:image001.png@01D90FB3.9BD63650"> <o:p></o:p></p>
<p style="margin-top:0cm"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><img border="0" width="600" height="151" style="width:6.25in;height:1.5729in" id="Picture_x0020_2" src="cid:image002.jpg@01D90FB3.9BD63650"></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FTOMRA.Food%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LQQCE8pOSeajbnisTc2RJZARrlZ7iXBObo4B3PCJ7ho%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_3" src="cid:image003.jpg@01D90FB3.9BD63650" alt="tomra facebook"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Ftomra-food%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Sd0bD%2BNJ8zz0aDGkMOfvqaoNDyfBuxYGOa2k5ckgQGk%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_4" src="cid:image004.jpg@01D90FB3.9BD63650" alt="tomra linkedin"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTOMRAFood&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961627432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IqIH07Pn39lD9YS957Y%2B9BFr%2Fl%2BhycEGLKmwpZp%2Fyp0%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_5" src="cid:image005.jpg@01D90FB3.9BD63650" alt="tomra twitter"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLDD3B1A7BAE919EC6&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961783642%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uj5TtR61aKhuqpesLt%2F%2FANttmJgm0qrjjny%2F9PBdRrk%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_6" src="cid:image006.jpg@01D90FB3.9BD63650" alt="tomra youtube"></span></a> <a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Ftomrafood%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961783642%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=B21%2FmybLppccsDOjblJEW8yRZKPyxuwy0EpyMWdv%2B1w%3D&reserved=0" target="_blank"><span style="text-decoration:none"><img border="0" width="30" height="30" style="width:.3125in;height:.3125in" id="Picture_x0020_7" src="cid:image007.jpg@01D90FB3.9BD63650" alt="tomra instragram"></span></a><br>
<span style="font-size:8.5pt;color:#6E8186"> <b>Compac Technologies Ltd</b> | 4 Henderson Place | PO Box 13 516 | Onehunga 1061 | New Zealand
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:8.5pt;color:#6E8186"> Phone: +64 96 34 00 88 |
<a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.compacsort.com%2F&data=05%7C01%7Cgavin.lambert%40tomra.com%7C9540a4ce797d4c92a37a08dadd5d0b8f%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C638065688961783642%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EJ9Efso%2Bm2A8EsEzH91R43X7x2%2BE6V0i%2FY3vLOOK%2BO4%3D&reserved=0">
https://www.compacsort.com</a></span><br>
<span 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><o:p></o:p></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>From:</b> 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></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-NZ">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">I have attached a patch for the --enable-regalias option.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">--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></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">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></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">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></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">The patch is based on mercurial revision 2679 (33b922ec1871) and the gavinl patchset 20171108.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-NZ">Graeme Foot.<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>