<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;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
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.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.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle26
        {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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Is this happening straight from boot, or is it initially working and then later going into a bad state?  I was assuming the latter.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If it’s happening straight from boot, then you should probably ask Beckhoff why the slave isn’t responding to 0x0910 shortly after boot (ideally with a Wireshark trace).  As far as I am aware, this is supposed to always work, if the slave
 is responding on EtherCAT at all.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">(In order to reach the point where it tries to read 0x0910, the slave must be successfully replying to reads of 0x0130 and writes of 0x0010.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Another thing you could possibly check is whether it happens when the slave is alone on the network or if it only happens when there is more than one slave.  For example, if you have some slaves that use a dip-switch station address or
 alias it’s possible that this could be conflicting with the address assignment used by Etherlab.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>

<P 
style="FONT-SIZE: 100%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: rgb(89,89,89)"><STRONG>Gavin Lambert<BR></STRONG>Senior Software Developer<BR></P>
<P style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
<TABLE>
  <TBODY 
  style="FONT-SIZE: 75%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: rgb(89,89,89)">  </TBODY></TABLE></P>
<P style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><IMG border=0 
src="cid:logo_compac_5dcf97ef-52f5-498c-8b9b-728410ddffaf.png"><BR><A 
href="http://www.compacsort.com"><IMG border=0 alt=TOMRA 
src="cid:compacicon_82e8a8c7-154a-4a32-9720-a5badb6258e0.png" width=33 
height=37></A> <A href="https://www.facebook.com/Compacsort"><IMG border=0 
alt=Facebook src="cid:facebook_fa85b924-53b9-45cc-8162-0564f64ec3a3.png" width=35 
height=37></A> <A 
href="https://www.linkedin.com/company/compac-sorting-equipment/"><IMG border=0 
alt=Linkedin src="cid:linkedin_4ec016ad-84fa-443c-85a3-b9615a4ccef8.png" width=35 
height=37></A> <A href="https://vimeo.com/compacsort"><IMG border=0 alt=Youtube 
src="cid:youtube_32142163-fc27-4aed-b14d-e8a377f98a6d.png" width=37 height=37></A> 
<A href="https://twitter.com/compacsort"><IMG border=0 alt=twitter 
src="cid:twitter_d89338d8-98c8-4b65-9a9e-7b1333160b0d.png" width=33 height=37></A> 
<A href="https://www.instagram.com/compacsort/"><IMG border=0 alt=instagram 
src="cid:insta2_1cd85de9-b3a2-4971-9904-52b2481a7c82.png" width=33 height=37></A> 
</P>
<P 
style="FONT-SIZE: 75%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: rgb(89,89,89)"><B>COMPAC 
SORTING EQUIPMENT LTD</B> | 4 Henderson Pl | Onehunga | Auckland 1061 | New 
Zealand<BR>Switchboard: +64 96 34 00 88 | <A 
href="http://www.tomra.com">tomra.com</A> </P>
<TABLE 
style="BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-COLLAPSE: collapse; BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none" 
cellSpacing=0 cellPadding=0 border=1>
  <TBODY>
  <TR>
    <TD 
    style="BORDER-LEFT-STYLE: none; BORDER-TOP: #595959 1pt solid; BORDER-BOTTOM: #595959 1pt solid; BORDER-RIGHT-STYLE: none" 
    vAlign=top>
      <P 
      style="FONT-SIZE: 75%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: rgb(89,89,89)">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. 
  </P></TD></TR></TBODY></TABLE>
<P 
style="FONT-SIZE: 75%; FONT-FAMILY: Calibri, Candara, Segoe, Optima, Arial, sans-serif; COLOR: rgb(89,89,89)"></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" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Graeme Foot <Graeme.Foot@touchcut.com>
<br>
<b>Sent:</b> Thursday, 26 September 2019 13:29<br>
<b>To:</b> Gavin Lambert <gavin.lambert@tomra.com>; etherlab-dev@etherlab.org<br>
<b>Subject:</b> RE: Hot plugged modules failing to read DC register<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There is no "AL status message" occurring in the syslog.  As such there is also no acknowledgement.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I just mentioned the reg_read request as an aside to say that I can't manually query the state of the slave while it is in SAFEOP+ERROR.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The error flag is set and the slave goes to SAFEOP+ERROR due to DC failing to sync.<o:p></o:p></p>
<p class="MsoNormal">DC fails to sync due to the master not setting the DC time offset.<o:p></o:p></p>
<p class="MsoNormal">The master does not set the DC time offset due to the has_dc_system_time flag not being set.<o:p></o:p></p>
<p class="MsoNormal">The has_dc_system_time flag is not set because the slave does not respond to the 0x0910 reg read request.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I'm not using any patch to disable automatic rescan as far as I'm aware.  I'm only using your patchset and the extra's I've submitted.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal">Graeme.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>>
<br>
<b>Sent:</b> Thursday, 26 September 2019 1:13 PM<br>
<b>To:</b> Graeme Foot <<a href="mailto:Graeme.Foot@touchcut.com">Graeme.Foot@touchcut.com</a>>;
<a href="mailto:etherlab-dev@etherlab.org">etherlab-dev@etherlab.org</a><br>
<b>Subject:</b> RE: Hot plugged modules failing to read DC register<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m not talking about a reg_read request.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When the slave first goes into SAFEOP+ERROR, the master should detect this during its regular slave scan cycle (fsm_master_state_read_al_status).  It then calls ec_fsm_change_ack to acknowledge the ERROR state – as it does this, it should
 report something like this to the syslog (even at debug 0 level):<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">kernel: [49369.927687] EtherCAT ERROR 0-main-2: AL status message 0x001B: "Sync manager watchdog".<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">kernel: [49369.953541] EtherCAT 0-main-2: Acknowledged state SAFEOP.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is the message that tells you why the slave was unhappy and went to the ERROR state in the first place.  After this, the slave should be in SAFEOP (no ERROR), and the master will usually then bring it back to INIT and do a full reconfigure
 and back to OP (if the master app is still running).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If you have the quick-op patch applied, and the AL status was 0x001B and not some other error (and the master hasn’t restarted since the slave entered the error state), then instead of going back to INIT in the above case it will try to
 go straight back from SAFEOP to OP to reduce the downtime.  As mentioned in the patch notes, this is fine in most cases but it can upset some DC slaves (as it may not give them enough time to resync), so you may want to disable this feature via configure. 
 (You can clearly see in the syslogs when it’s attempting a quick return to OP.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The slave should always accept acknowledging the ERROR state and returning to INIT.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The “slave has error_flag set” thing is different; that’s referring to slave->error_flag, which is only set when the slave fails to respond correctly to requests (such as refusing to perform AL state changes or not responding to internal
 register requests), despite still responding to the broadcast AL state request (used to determine the number of active slaves).  The only way to clear this flag is to rescan, either via “ethercat rescan” or by the automatic rescan that it performs when the
 number of slaves changes (as it normally does during a genuine comms interruption).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So have a look further back in the logs to see why the error_flag is being set in the first place.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Though also make sure that you’re not using any extra patches which disable the automatic rescan.  I recall someone on this list a while ago suggesting this was a good idea; it isn’t.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p><strong><span style="font-family:"Calibri",sans-serif;color:#595959">Gavin Lambert</span></strong><b><span style="color:#595959"><br>
</span></b><span style="color:#595959">Senior Software Developer<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
<p><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><img border="0" width="360" height="102" style="width:3.75in;height:1.0625in" id="Picture_x0020_1" src="cid:image001.png@01D5746E.E4A634E0" alt="cid:image001.png@01D5746C.903BDD30"><br>
</span><a href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.compacsort.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287553857&sdata=jK8uMH%2BxJGf68Wdps9f39XM4sSG2iWwXn1E%2BcuiVyZs%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="33" height="37" style="width:.3437in;height:.3854in" id="Picture_x0020_2" src="cid:image002.png@01D5746E.E4A634E0" alt="TOMRA"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FCompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287553857&sdata=cq%2Ff4sD6VXB9y26TgwTKUN%2F3F8NdjCmZ5Iz7HU0AGbY%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="35" height="37" style="width:.3645in;height:.3854in" id="Picture_x0020_3" src="cid:image003.png@01D5746E.E4A634E0" alt="Facebook"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fcompac-sorting-equipment%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287563846&sdata=dxFlmzB%2F4z6M%2BAwpySfYlDRw3KUloBRnQ1ZEdwzEUtk%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="35" height="37" style="width:.3645in;height:.3854in" id="Picture_x0020_4" src="cid:image004.png@01D5746E.E4A634E0" alt="Linkedin"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvimeo.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287563846&sdata=%2FODnyaJ%2BRpJZq3z%2BhrdgOcgwTRsZv8UKw%2BrDX8KBWVM%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="37" height="37" style="width:.3854in;height:.3854in" id="Picture_x0020_5" src="cid:image005.png@01D5746E.E4A634E0" alt="Youtube"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287573842&sdata=t%2BADAhxRgc8BL8PRhbgf%2FbLNbbBRI3DyHCKz5uh5blE%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="33" height="37" style="width:.3437in;height:.3854in" id="Picture_x0020_6" src="cid:image006.png@01D5746E.E4A634E0" alt="twitter"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Fcompacsort%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287573842&sdata=31dKhFmEdB1hcMy%2FOuuSkgpWejUKeanQ7P2%2FILeFAJc%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="33" height="37" style="width:.3437in;height:.3854in" id="Picture_x0020_7" src="cid:image007.png@01D5746E.E4A634E0" alt="instagram"></span></a><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p><b><span style="font-size:8.5pt;color:#595959">COMPAC SORTING EQUIPMENT LTD</span></b><span style="font-size:8.5pt;color:#595959"> | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand<br>
Switchboard: +64 96 34 00 88 | </span><a href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tomra.com&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287573842&sdata=fvmceEtiRCNHMAT27KfgqZOKwOFZpjIHmYQC%2Bt5KMFo%3D&reserved=0"><span style="font-size:8.5pt">tomra.com</span></a><span style="font-size:8.5pt;color:#595959">
<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td valign="top" style="border-top:solid #595959 1.0pt;border-left:none;border-bottom:solid #595959 1.0pt;border-right:none;padding:0cm 0cm 0cm 0cm">
<p><span style="font-size:8.5pt;font-family:"Times New Roman",serif;color:#595959">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.
<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<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" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Graeme Foot <</span><a href="mailto:Graeme.Foot@touchcut.com"><span lang="EN-US" style="mso-fareast-language:EN-NZ">Graeme.Foot@touchcut.com</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ">>
<br>
<b>Sent:</b> Thursday, 26 September 2019 12:32<br>
<b>To:</b> Gavin Lambert <</span><a href="mailto:gavin.lambert@tomra.com"><span lang="EN-US" style="mso-fareast-language:EN-NZ">gavin.lambert@tomra.com</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ">>;
</span><a href="mailto:etherlab-dev@etherlab.org"><span lang="EN-US" style="mso-fareast-language:EN-NZ">etherlab-dev@etherlab.org</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ"><br>
<b>Subject:</b> RE: Hot plugged modules failing to read DC register<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Gavin,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When 0x0910 returns a working counter of 0 the master assumes the slave only supports delay measurement and the slave->has_dc_system_time flag remains zero.  If the flag is zero a few DC configuration steps are missed.  Subsequently, when
 the slave DC Assign Active value is set the slave has not been set up to use DC correctly and fails to sync.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So without the patch (extracts from attached "DC Sync Error.txt"):<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.369125] EtherCAT DEBUG 0-main-3: Ready for requests.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[  270.376908] EtherCAT DEBUG 0-main-3: Slave has no System Time register; delay measurement only.<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.393234] EtherCAT WARNING 0-main-3: SII Read Error, EEPROM not loaded.  Retrying...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.476850] EtherCAT 0-main-3: SII EEPROM loaded.  Continuing.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.916606] EtherCAT DEBUG 0-main-3: Unknown category type 0x003C.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.916612] EtherCAT DEBUG 0-main-3: Slave is not in the state to do mailbox com (INIT), setting to PREOP.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.916616] EtherCAT DEBUG 0-main-3: Configuring...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.920595] EtherCAT DEBUG 0-main-3: Now in INIT.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.920598] EtherCAT DEBUG 0-main-3: Clearing FMMU configurations...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.920601] EtherCAT DEBUG 0-main-3: Clearing mailbox check flag...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.922603] EtherCAT DEBUG 0-main-3: Clearing sync manager configurations...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.924595] EtherCAT DEBUG 0-main-3: Configuring mailbox sync managers...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.924600] EtherCAT DEBUG 0-main-3: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.924605] EtherCAT DEBUG 0-main-3: SM1: Addr 0x1080, Size 128, Ctrl 0x22, En 1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.930589] EtherCAT DEBUG 0-main-3: Now in PREOP.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  270.930592] EtherCAT DEBUG 0-main-3: Finished configuration.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[  273.639104] EtherCAT WARNING 0-main-3: Slave seems not to support distributed clocks!<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  273.647686] EtherCAT DEBUG 0-main-3: Setting DC cycle times to 1000000 / 0.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  273.649100] EtherCAT DEBUG 0-main-3: Checking for synchrony.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  273.743070] EtherCAT DEBUG 0-main-3: Sync after  100 ms: 1828300146 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  273.842996] EtherCAT DEBUG 0-main-3: Sync after  200 ms: 1828303744 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.440471] EtherCAT DEBUG 0-main-3: Sync after 4800 ms: 1830172951 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.540418] EtherCAT DEBUG 0-main-3: Sync after 4900 ms: 1830251113 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.640369] EtherCAT WARNING 0-main-3: Slave did not sync after 5000 ms.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648810] EtherCAT DEBUG 0-main-3: app_start_time=0<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648814] EtherCAT DEBUG 0-main-3:       app_time=289356014683<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648817] EtherCAT DEBUG 0-main-3:     start_time=289456014683<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648820] EtherCAT DEBUG 0-main-3:          cycle=1000000<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648824] EtherCAT DEBUG 0-main-3:     shift_time=500000<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648827] EtherCAT DEBUG 0-main-3:      remainder=14683<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648830] EtherCAT DEBUG 0-main-3:          start=289457500000<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.648850] EtherCAT DEBUG 0-main-3: Setting DC cyclic operation start time to 289457500000.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.650379] EtherCAT DEBUG 0-main-3: Setting DC AssignActivate to 0x0300.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  278.695998] EtherCAT DEBUG 0-main-3: Now in SAFEOP.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[  283.688588] EtherCAT ERROR 0-main-3: Timeout while setting state OP.<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt">[  283.726198] EtherCAT 0: Slave states on main device: PREOP, SAFEOP, OP + ERROR.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[  283.766130] EtherCAT DEBUG 0-main-3: SAFEOP -> SAFEOP + ERROR.<o:p></o:p></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Comparing that to with the patch (extracts from the attached "DC With Patch.txt"):<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   47.873112] EtherCAT DEBUG 0-main-3: Ready for requests.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   47.873140] EtherCAT DEBUG 0-main-3: Scanning slave 3 on main link.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   47.881120] EtherCAT WARNING 0-main-3: Slave did not respond to System Time register request, retrying...<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   47.956443] EtherCAT 0-main-3: Slave has the System Time register.<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.021036] EtherCAT DEBUG 0-main-3: SII firmware file not found; reading SII data from slave.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.400841] EtherCAT DEBUG 0-main-3: Unknown category type 0x003C.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.400848] EtherCAT DEBUG 0-main-3: Slave is not in the state to do mailbox com (INIT), setting to PREOP.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.400852] EtherCAT DEBUG 0-main-3: Configuring...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.404827] EtherCAT DEBUG 0-main-3: Now in INIT.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.404831] EtherCAT DEBUG 0-main-3: Clearing FMMU configurations...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.404835] EtherCAT DEBUG 0-main-3: Clearing mailbox check flag...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.406831] EtherCAT DEBUG 0-main-3: Clearing sync manager configurations...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   48.408828] EtherCAT DEBUG 0-main-3: Clearing DC assignment...<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.410832] EtherCAT DEBUG 0-main-3: Configuring mailbox sync managers...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.410839] EtherCAT DEBUG 0-main-3: SM0: Addr 0x1000, Size 128, Ctrl 0x26, En 1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.410843] EtherCAT DEBUG 0-main-3: SM1: Addr 0x1080, Size 128, Ctrl 0x22, En 1<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.416831] EtherCAT DEBUG 0-main-3: Now in PREOP.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   48.416836] EtherCAT DEBUG 0-main-3: Finished configuration.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   49.991966] EtherCAT DEBUG 0-main-3: Checking system time offset.<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   49.993418] EtherCAT DEBUG 0-main-3: DC 64 bit system time offset calculation: system_time=2217603868, app_time=59887013582, diff=57669409714<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   49.993423] EtherCAT DEBUG 0-main-3: Setting time offset to 57669409714 (was 0)<o:p></o:p></b></p>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   51.152316] EtherCAT DEBUG 0-main-3: Setting DC cycle times to 1000000 / 0.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   51.154320] EtherCAT DEBUG 0-main-3: Checking for synchrony.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   51.256259] EtherCAT DEBUG 0-main-3: Sync after  100 ms:      14466 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   51.354208] EtherCAT DEBUG 0-main-3: Sync after  200 ms:      14695 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   51.955878] EtherCAT DEBUG 0-main-3: Sync after  800 ms:      12253 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.053823] EtherCAT DEBUG 0-main-3: Sync after  900 ms:      11113 ns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133801] EtherCAT DEBUG 0-main-3: 10000 ns difference after 970 ms.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133806] EtherCAT DEBUG 0-main-3: app_start_time=0<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133810] EtherCAT DEBUG 0-main-3:       app_time=62029021245<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133813] EtherCAT DEBUG 0-main-3:     start_time=62129021245<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133816] EtherCAT DEBUG 0-main-3:          cycle=1000000<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133820] EtherCAT DEBUG 0-main-3:     shift_time=500000<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133823] EtherCAT DEBUG 0-main-3:      remainder=21245<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133826] EtherCAT DEBUG 0-main-3:          start=62130500000<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.133829] EtherCAT DEBUG 0-main-3: Setting DC cyclic operation start time to 62130500000.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.135789] EtherCAT DEBUG 0-main-3: Setting DC AssignActivate to 0x0300.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt">[   52.184538] EtherCAT DEBUG 0-main-3: Now in SAFEOP.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><b>[   52.749441] EtherCAT DEBUG 0-main-3: Now in OP. Finished configuration.<o:p></o:p></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Without the patch there is no AL Error code, just a failure to DC Sync.  Without the slave->has_dc_system_time flag being set the DC time offset is not applied so the slave has no chance to sync.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Without the patch it took the slave approx. 108ms for the SII loading to be complete.  With the patch it took approx. 83ms for the 0x0910 register to respond.  They are generally a similar timeframe so I suspect the slave does not reliably
 respond while it is still initialising.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Also, restarting the application or manually changing the modules state to INIT or PREOP and back to OP doesn't sort out the flag.  If there has been enough time for the modules DC clock to eventually sync it will reach OP, but if not it
 will go back to SAFEOP + ERROR.  It takes a "rescan" command to the master to sort out the flag so that the offset calculation can be performed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've also found that when the slave is in SAFEOP + ERROR reg_read requests (and pretty much all communications to the slave) fail due to "Aborting register request, slave has error flag set.".  So it’s a little hard to manually check if
 there's any error status set.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Graeme.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></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" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Gavin Lambert <</span><a href="mailto:gavin.lambert@tomra.com"><span lang="EN-US" style="mso-fareast-language:EN-NZ">gavin.lambert@tomra.com</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ">>
<br>
<b>Sent:</b> Wednesday, 25 September 2019 5:06 PM<br>
<b>To:</b> Graeme Foot <</span><a href="mailto:Graeme.Foot@touchcut.com"><span lang="EN-US" style="mso-fareast-language:EN-NZ">Graeme.Foot@touchcut.com</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ">>;
</span><a href="mailto:etherlab-dev@etherlab.org"><span lang="EN-US" style="mso-fareast-language:EN-NZ">etherlab-dev@etherlab.org</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ"><br>
<b>Subject:</b> RE: Hot plugged modules failing to read DC register<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When the slave goes to safeop+error it should also output an AL error code which might give a hint as to why.  This should be logged to the syslog when the master acknowledges the error.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">AL error 0x001B, for example, indicates that the slave stopped receiving SM frames (typical of a comms interruption) – and features/quick-op in the patchset tries to do a quicker recovery for this case by trying to go straight back to OP
 instead of going through a full PREOP reconfiguration.  It’s possible that some slaves may need the full reconfigure, so you can disable this behaviour at configure time.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Other AL error codes mean other things, such as your DC cycle being poorly synced and frames not occurring in a strict SYNC0-SM-SYNC0-SM ordering.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But I wouldn’t normally expect any standard registers to fail WC when this occurs, unless perhaps the slave was performing a full power reset (or otherwise holding the slave’s ESC in reset).  Though this would interrupt comms to any downstream
 slaves as well, so it’s not something that slaves are supposed to do of their own accord.  (And it shouldn’t stay in safeop+error in that case, it should revert to Init, although that’s up to the slave implementation.)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">90ms seems a bit slow for just an ESC power-on SII read, although it’s possible that it’s doing something more complicated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m not really familiar with those modules, however; you’re probably best off asking Beckhoff directly.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p><strong><span style="font-family:"Calibri",sans-serif;color:#595959">Gavin Lambert</span></strong><b><span style="color:#595959"><br>
</span></b><span style="color:#595959">Senior Software Developer<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
<p><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><img border="0" width="360" height="102" style="width:3.75in;height:1.0625in" id="Picture_x0020_8" src="cid:image001.png@01D5746E.E4A634E0" alt="cid:image001.png@01D5746C.903BDD30"><br>
</span><a href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.compacsort.com&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287583837&sdata=UXtgq4Xj0UkRnGUMXMAkuKK5lMveUdmC18EMmgN2gNs%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="33" height="37" style="width:.3437in;height:.3854in" id="Picture_x0020_9" src="cid:image002.png@01D5746E.E4A634E0" alt="TOMRA"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FCompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287583837&sdata=DODoo%2Fa9DEr27ngRgo%2Ff01U3NmQY2GpRQocsZphH8Us%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="35" height="37" style="width:.3645in;height:.3854in" id="Picture_x0020_10" src="cid:image003.png@01D5746E.E4A634E0" alt="Facebook"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fcompac-sorting-equipment%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287593828&sdata=PqdlIDuofNUAssrCQWVdb%2FV2otsAWt6z%2FsV3Fk3%2Ftjk%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="35" height="37" style="width:.3645in;height:.3854in" id="Picture_x0020_11" src="cid:image004.png@01D5746E.E4A634E0" alt="Linkedin"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvimeo.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287593828&sdata=AG7tu7odfehlcl7X3AJpo7Yn4ufIBkJvEM8y1QHWnLs%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="37" height="37" style="width:.3854in;height:.3854in" id="Picture_x0020_12" src="cid:image005.png@01D5746E.E4A634E0" alt="Youtube"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287603825&sdata=Wjk7dnYmtzp0iK77bSGPDXRlc0clmKOu9TFKeYq9Vac%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="33" height="37" style="width:.3437in;height:.3854in" id="Picture_x0020_13" src="cid:image006.png@01D5746E.E4A634E0" alt="twitter"></span></a><a href="https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Fcompacsort%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287603825&sdata=87NwenEqjDGaxQ8T%2FVu1Me6Z7kLxecRmnz0CiaMinVA%3D&reserved=0"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;text-decoration:none"><img border="0" width="33" height="37" style="width:.3437in;height:.3854in" id="Picture_x0020_14" src="cid:image007.png@01D5746E.E4A634E0" alt="instagram"></span></a><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p><b><span style="font-size:8.5pt;color:#595959">COMPAC SORTING EQUIPMENT LTD</span></b><span style="font-size:8.5pt;color:#595959"> | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand<br>
Switchboard: +64 96 34 00 88 | </span><a href="https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tomra.com&data=02%7C01%7Cgavin.lambert%40tomra.com%7C0543a19991544bd80c6708d74220dee0%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C637050581287603825&sdata=s3FNifrD5%2BtEUTPCI2RO4EGJLK7R0UDPMZHmzhpDTCE%3D&reserved=0"><span style="font-size:8.5pt">tomra.com</span></a><span style="font-size:8.5pt;color:#595959">
<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td valign="top" style="border-top:solid #595959 1.0pt;border-left:none;border-bottom:solid #595959 1.0pt;border-right:none;padding:0cm 0cm 0cm 0cm">
<p><span style="font-size:8.5pt;font-family:"Times New Roman",serif;color:#595959">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.
<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<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" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Graeme Foot<br>
<b>Sent:</b> Tuesday, 24 September 2019 17:20<br>
<b>To:</b> </span><a href="mailto:etherlab-dev@etherlab.org"><span lang="EN-US" style="mso-fareast-language:EN-NZ">etherlab-dev@etherlab.org</span></a><span lang="EN-US" style="mso-fareast-language:EN-NZ"><br>
<b>Subject:</b> [etherlab-dev] Hot plugged modules failing to read DC register<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've had occasional issues with EL7332 and EL7342 modules where they will go to SafeOp + Error if you try and use them in DC mode.  I've finally had some time to look into it a little further.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When the modules go to SafeOp + Error the master outputs the message "Slave has no System Time register; delay measurement only." (with debug level 1).  This occurs due to the datagram reading register 0x0910 returning a working counter
 of zero.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I created a quick hack to retry reading the register up to 100 times before failing.  After approx. 90ms the EL7342 module I'm testing with successfully returned the datagram and the slave entered Op state successfully.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In my test setup I also have an EL5101 module that was doing the exact same thing (and taking around the same time), but I've never really had issues with them before.  I suspect the difference is that if you have incorrect settings on
 the EL7342 module and try to run a motor it can error out and reset itself, causing a situation equivalent to a hot plug.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Without my hack both modules need to wait for the SII read to complete for a similar length of time, so it looks like the slaves do not respond to the 0x0910 register request until the EEPROM read is complete.  Does anyone know if this
 is expected behaviour, or know of a better solution than to retry reading the register (up to 200ms ???)?<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.<o:p></o:p></p>
</div>
</body>
</html>