<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Richard and Graeme,</p>
    <p>Richard, do you know if the feature Graeme mentioned is included
      in official branch?</p>
    <p>And thank you Graeme for your message. What should I check if the
      version I used has this patch? It was some time ago when my
      colleague created an image of the system, and I'm not sure where
      is the source code of the EtherCAT master that was used.</p>
    <p>Best regards,</p>
    <p>Oguz.</p>
    <div class="moz-cite-prefix">On 15-Mar-26 11:28 PM, Graeme Foot
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:716322ce3143400bbeef75c373ab964e@touchcut.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}@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:Aptos;}@font-face
        {font-family:"Segoe UI Emoji";
        panose-1:2 11 5 2 4 2 4 2 2 3;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}span.EmailStyle23
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}div.WordSection1
        {page:WordSection1;}ol
        {margin-bottom:0cm;}ul
        {margin-bottom:0cm;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US">Hi Oguz,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US">I
            haven’t looked at all closely to the issue (and a couple of
            emails got blocked by our spam/virus filter), but if you
            suspect that the slaves SII information is incorrect then
            you can try supplying the SII information yourself, rather
            than the master downloading if from the slave.  If that then
            works, you can check for the differences between the SII on
            the slave and the data provided by the esi file.  If
            confirmed you can request the vendor provides an update for
            the slave with the correct SII information (or continue
            using the manual SII file).<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US">We use
            quite an old EtherLab master with patches to allow loading
            your own SII file instead of the master downloading it from
            the slave (from gavinl’s patchset
            “0001-load-sii-from-file.patch”).  I don’t know what’s
            available in your master configuration, but in ours we copy
            the SII file to “/lib/firmware/ethercat”<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US">To
            create an SII file:<o:p></o:p></span></p>
        <ul style="margin-top:0cm" type="disc">
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Start
              a new TwinCAT project (TwinCAT XAE Project (XML Format))<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Under
              I/O, Devices add an EtherCAT Master device<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">If you
              don’t have the correct esi (.xml) file loaded:<o:p></o:p></span>
            <ul style="margin-top:0cm" type="circle">
              <li class="MsoListParagraph"
                style="margin-left:0cm;mso-list:l0 level2 lfo2"><span
                  style="font-size:11.0pt;mso-fareast-language:EN-US">copy
                  the slaves esi (.xml) file into:
                  C:\TwinCAT\3.1\Config\Io\EtherCAT<o:p></o:p></span></li>
              <li class="MsoListParagraph"
                style="margin-left:0cm;mso-list:l0 level2 lfo2"><span
                  style="font-size:11.0pt;mso-fareast-language:EN-US">Select
                  the TwinCAT, EtherCAT Devices, Reload Device
                  Descriptions menu option<o:p></o:p></span></li>
            </ul>
          </li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Add
              you EtherCAT slave to the EtherCAT master device<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Open
              your slave<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Select
              the EtherCAT tab<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Select
              Advanced Settings...<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Select
              the ESC Access, E2PROM, Hex Editor item<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Confirm
              the SII contains the expected values (for Vendor ID ,
              Product Code etc)<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Select
              the Write to File... button<o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="margin-left:0cm;mso-list:l0 level1 lfo2"><span
              style="font-size:11.0pt;mso-fareast-language:EN-US">Save
              with a filename in the format
              “ec_{vendor_id_hex}_{product_code_hex}[_{revision_hex}].bin”<o:p></o:p></span>
            <ul style="margin-top:0cm" type="circle">
              <li class="MsoListParagraph"
                style="margin-left:0cm;mso-list:l0 level2 lfo2"><span
                  style="font-size:11.0pt;mso-fareast-language:EN-US">The
                  revision part is optional.<o:p></o:p></span></li>
              <li class="MsoListParagraph"
                style="margin-left:0cm;mso-list:l0 level2 lfo2"><span
                  style="font-size:11.0pt;mso-fareast-language:EN-US">e.g.:
                  ec_00000539_02200001_00010000.bin<o:p></o:p></span></li>
            </ul>
          </li>
        </ul>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;mso-fareast-language:EN-US">Graeme.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;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"
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span
                lang="EN-US"
style="font-size:11.0pt;font-family:"Calibri",sans-serif">
                Etherlab-users
                <a class="moz-txt-link-rfc2396E" href="mailto:etherlab-users-bounces@etherlab.org"><etherlab-users-bounces@etherlab.org></a>
                <b>On Behalf Of </b>Bilko AS, Oguz Dilmac<br>
                <b>Sent:</b> Saturday, 7 March 2026 02:30<br>
                <b>To:</b> Richard Hacker <a class="moz-txt-link-rfc2396E" href="mailto:ha@igh.de"><ha@igh.de></a>;
                <a class="moz-txt-link-abbreviated" href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a><br>
                <b>Subject:</b> Re: [Etherlab-users] Timeout while
                setting state INIT.<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p>Hi,<o:p></o:p></p>
        <p>We are still working on the problematic slave which doesn't
          go to INIT. I'm trying to understand the difference by
          examining wireshark logs.<o:p></o:p></p>
        <p>I noticed these following messages are sent at the beginning.
          And the device changed to INIT itself. It seems as if there is
          something wrong with SM configuration?<o:p></o:p></p>
        <table class="MsoNormalTable" border="1" cellpadding="0"
          width="100%" style="width:100.0%">
          <tbody>
            <tr>
              <td valign="top" style="padding:1.5pt 1.5pt 1.5pt 1.5pt">
                <p><span
style="font-size:10.0pt;font-family:"Times New Roman",serif">FPRD:
                    0x80d Return value: 0x30 (SM error / sm enable
                    acknowledged)<br>
                    <br>
                    FPWR: 0x800 16 byte data: 0    (Clear SM0 and 1?)<br>
                    FPWR: 0x800 8 byte data: 0010000426000100  (Re write
                    SM according to XML file?)<br>
                    FPWR: 0x808 8 byte data: 0014000422000100<br>
                    FPWR: 0x810 16 byte data: 0     (Clear SM2 and 3?)<br>
                    <br>
                    FPWR: 0x620 16 byte data:
                    00000009010000000d08000101000000 (define FMMU?)<br>
                    FPWR: 0x500 1 byte data: 01<o:p></o:p></span></p>
                <p><span
style="font-size:10.0pt;font-family:"Times New Roman",serif">FPWR:
                    0x120 2 byte data: 0012 (PreOP + Error ACK)<br>
                    FPRD: 0x130 Return value: 0x0002 (PREOP)<o:p></o:p></span></p>
                <p><span
style="font-size:10.0pt;font-family:"Times New Roman",serif">FPRD:
                    0x80D Return value: 0x00 (The error is gone!)<br>
                    <br>
                    FPRD: 0x1400 Return value: 0x00 (but WC is zero. I
                    guess the slave didn't processed it)<o:p></o:p></span></p>
                <p><span
style="font-size:10.0pt;font-family:"Times New Roman",serif">FPRD:
                    0x130 Return value: 0x0001 (INIT) (Slave went to
                    INIT. But I didn't see a write to 0x120 to go to
                    INIT)<br>
                    <br>
                    FPWR: 0x800 16 byte data: 0<br>
                    FPRD: 0x1400 Return value: 0x5208<br>
                    FPWR: 0x620 16 byte data: 0<br>
                    FPRD: 0x1400 Return value: 1024 byte data...0x80<o:p></o:p></span></p>
                <p class="MsoNormal">...<o:p></o:p></p>
              </td>
            </tr>
          </tbody>
        </table>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p>Could this be the reason why the slave don't go to INIT when
          IgH master ask? <o:p></o:p></p>
        <p>By the way I tried to write the right values to 0x800 via
          ecrt_reg_request_write. I tried to call this function right
          after ecrt_master_activate. But it didn't work. <o:p></o:p></p>
        <p>You can find the log file at the attachments. I hope someone
          can give me a suggestion.<o:p></o:p></p>
        <p>Best regards,<o:p></o:p></p>
        <p>Oguz.<o:p></o:p></p>
        <p><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">On 25-Feb-26 3:42 PM, Bilko AS, Oguz
            Dilmac wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p>Hi Again,<o:p></o:p></p>
          <p>I just sent some dmesg outputs and a test program using a
            new ethercat library. Unfortunately it hit a max 200KB
            attachment limit. Sorry I didn't notice this limit before.
            And could not cancel my message either.<o:p></o:p></p>
          <p>Anyway, I uploaded the files to wetransfer. I also uploaded
            a wireshark log of twincat while the problem device goes to
            OP. Here is the link:<o:p></o:p></p>
          <p><a href="https://we.tl/t-Yl7iRMSadB" moz-do-not-send="true"
              class="moz-txt-link-freetext">https://we.tl/t-Yl7iRMSadB</a><o:p></o:p></p>
          <p>I also copy my previous message here:<o:p></o:p></p>
          <p><i>Hello, <br>
              <br>
              We went to customer side and used a test PC with ethercat
              library 1.6.7. We also used slave timeout function with 10
              seconds.
              <br>
              <br>
              We build a simple setup with only one device and one test
              PC. Still the old device is going OP, and the new device
              don't.
              <br>
              <br>
              At the attachments you can find some dmesg outputs. I also
              attached the simple test program I used.
              <br>
              <br>
              Some explanations for dmesg outputs: <br>
              <br>
              * dmesg.OK.txt: Output for the working device. I just put
              it here as a reference <br>
              <br>
              * dmesg.Problem.txt: Output of the problematic device. <br>
              <br>
              * dmesg.Problem.freerun.txt: I tried to activate freerun
              with ecrt_slave_config_dc(sc, 0, 0, 0, 0, 0); I put it
              right before ecrt_master_activate().
              <br>
              <br>
              * dmesg.Problem.ManualStateChange: I tried to change state
              via command line tool.
              <br>
              <br>
              We also checked and see that both devices are going to OP
              with twincat. If you suggest a way to get some log from
              twincat, we can try.
              <br>
              <br>
              We are stuck </i><i><span
style="font-family:"Segoe UI Emoji",sans-serif">🙁</span> If
              you have any idea It would be great.
              <br>
              <br>
              Best regards, <br>
              <br>
              Oguz. </i><o:p></o:p></p>
          <p><o:p> </o:p></p>
          <div>
            <p class="MsoNormal">On 20-Feb-26 1:30 PM, Richard Hacker
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <pre>On Fri, 2026-02-20 at 12:49 +0300, Bilko AS, Oguz Dilmac wrote:<o:p></o:p></pre>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <pre>Hi,<o:p></o:p></pre>
              <pre><o:p> </o:p></pre>
              <pre>We will try to install the newest ethercat library version.<o:p></o:p></pre>
              <pre><o:p> </o:p></pre>
              <pre>By the way, we tried one version older of this device. It goes to OP <o:p></o:p></pre>
              <pre>with no problem.<o:p></o:p></pre>
            </blockquote>
            <pre>Well, this shows that your configuration is probably not the issue and<o:p></o:p></pre>
            <pre>is at the problem is at the slave's side<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <pre><o:p> </o:p></pre>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <pre>Also our customer has a bechoff controller as well, and they say that<o:p></o:p></pre>
              <pre>with twincat both devices are going to OP without a problem.<o:p></o:p></pre>
            </blockquote>
            <pre>TwinCAT is not the standard, neither is our EtherCAT master. However,<o:p></o:p></pre>
            <pre>both should implement the standard, but they do it differently<o:p></o:p></pre>
            <pre>(naturally), especially regarding timing. The standard however ensures<o:p></o:p></pre>
            <pre>that EtherCAT masters and slaves are immune to timing issues, but there<o:p></o:p></pre>
            <pre>are always exceptions!<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <pre>We will try to go to the customer and check with the newest ethercat <o:p></o:p></pre>
              <pre>master version. We are also considering to connect the both devices<o:p></o:p></pre>
              <pre>to <o:p></o:p></pre>
              <pre>the twincat and see if the twincat behaves different. Do you think <o:p></o:p></pre>
              <pre>checking the transmitted data via wireshark worth trying?<o:p></o:p></pre>
            </blockquote>
            <pre>You can try, but I do not see that you'll get much insight using<o:p></o:p></pre>
            <pre>wireshark. The master commands the slave to go to INIT and there is<o:p></o:p></pre>
            <pre>simply no reply from the slave acknowledging the state change. That is<o:p></o:p></pre>
            <pre>why the master times out and gives up trying to bring the slave online.<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <pre>Going to INIT is such a primitive state change for a slave that there<o:p></o:p></pre>
            <pre>should be absolutely _no_ reason it takes any amount of time. So I am<o:p></o:p></pre>
            <pre>not even convinced that ecrt_slave_config_state_timeout() would work.<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <pre>I only know that some (complex) slaves may take time between PREOP-<o:p></o:p></pre>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <pre>SAFEOP and SAFEOP->OP transition when certain hardware needs to be<o:p></o:p></pre>
            </blockquote>
            <pre>configured based on its configuration. But your slave is not there yet.<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <pre>Before you use wireshark you can try switching debug to 1<o:p></o:p></pre>
            <pre>`ethercat debug 1`<o:p></o:p></pre>
            <pre><o:p> </o:p></pre>
            <pre><o:p> </o:p></pre>
          </blockquote>
          <pre>-- <o:p></o:p></pre>
          <pre>Oguz Dilmac<o:p></o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>Bilko AS, R&D Manager<o:p></o:p></pre>
          <pre>====================================<o:p></o:p></pre>
          <pre>Perpa Ticaret Merkezi B Blok Kat 13 Nr. 2536<o:p></o:p></pre>
          <pre>TR-34384 Okmeydani Istanbul Turkey<o:p></o:p></pre>
          <pre>Tel : +90 212 563 00 00<o:p></o:p></pre>
          <pre>e-mail : <a href="mailto:odilmac@bilko-automation.com"
          moz-do-not-send="true" class="moz-txt-link-freetext">odilmac@bilko-automation.com</a><o:p></o:p></pre>
          <pre>web site : <a href="http://www.bilko-automation.com"
          moz-do-not-send="true" class="moz-txt-link-freetext">http://www.bilko-automation.com</a><o:p></o:p></pre>
          <pre><a href="https://www.youtube.com/@LyncaCNC"
          moz-do-not-send="true" class="moz-txt-link-freetext">https://www.youtube.com/@LyncaCNC</a><o:p></o:p></pre>
        </blockquote>
        <pre>-- <o:p></o:p></pre>
        <pre>Oguz Dilmac<o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre>Bilko AS, R&D Manager<o:p></o:p></pre>
        <pre>====================================<o:p></o:p></pre>
        <pre>Perpa Ticaret Merkezi B Blok Kat 13 Nr. 2536<o:p></o:p></pre>
        <pre>TR-34384 Okmeydani Istanbul Turkey<o:p></o:p></pre>
        <pre>Tel : +90 212 563 00 00<o:p></o:p></pre>
        <pre>e-mail : <a href="mailto:odilmac@bilko-automation.com"
        moz-do-not-send="true" class="moz-txt-link-freetext">odilmac@bilko-automation.com</a><o:p></o:p></pre>
        <pre>web site : <a href="http://www.bilko-automation.com"
        moz-do-not-send="true" class="moz-txt-link-freetext">http://www.bilko-automation.com</a><o:p></o:p></pre>
        <pre><a href="https://www.youtube.com/@LyncaCNC"
        moz-do-not-send="true" class="moz-txt-link-freetext">https://www.youtube.com/@LyncaCNC</a><o:p></o:p></pre>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Oguz Dilmac

Bilko AS, R&D Manager
====================================
Perpa Ticaret Merkezi B Blok Kat 13 Nr. 2536
TR-34384 Okmeydani Istanbul Turkey
Tel : +90 212 563 00 00
e-mail : <a class="moz-txt-link-abbreviated" href="mailto:odilmac@bilko-automation.com">odilmac@bilko-automation.com</a>
web site : <a class="moz-txt-link-freetext" href="http://www.bilko-automation.com">http://www.bilko-automation.com</a>
<a class="moz-txt-link-freetext" href="https://www.youtube.com/@LyncaCNC">https://www.youtube.com/@LyncaCNC</a></pre>
  </body>
</html>