<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)">
<style><!--
/* Font Definitions */
@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:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:929586329;
mso-list-template-ids:1802517620;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Wingdings;}
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]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi everyone,<o:p></o:p></p>
<p class="MsoNormal">I'd like to give you a bit of background before describing the issue.<o:p></o:p></p>
<p class="MsoNormal">In our lab, we’ve been using the EtherCAT Master library for a while, and so far, we’ve had no issues setting up communication between the master and various slave devices. Based on the examples from the GitLab repository, we developed
a more user-friendly wrapper around the <i>ecrt.h</i> library. Among other things, this wrapper ensures that several conditions are met before starting PDO read/write operations—for example, it checks that both the master and all slaves reach the EC_AL_OP_STATE,
and that the domain state counter is correct.<o:p></o:p></p>
<p class="MsoNormal">To configure communication, we typically write a class for each slave, which includes the structures
<i>ec_pdo_entry_reg_t</i>, <i>ec_pdo_entry_info_t</i>, <i>ec_pdo_info_t</i>, and <i>
ec_sync_info_t</i>. These are filled based on the output of the <i>ethercat cstruct</i> command.<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">In all previous use cases, the slaves supported remapping of the default PDOs and didn’t contain placeholder entries between PDO registers. However, in our current project, we're working with a slave that has:<o:p></o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoNormal" style="mso-list:l0 level1 lfo1">Fixed PDO mapping,<o:p></o:p></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1">A relatively large number of PDOs (315), and<o:p></o:p></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1">Several placeholder entries (57 in total) scattered throughout the PDO mapping.<o:p></o:p></li></ul>
<p class="MsoNormal">I’ve defined the structures mentioned above to reflect this layout, including the placeholders, and ensured the read/write functions also account for them.<o:p></o:p></p>
<p class="MsoNormal">When communication starts, both the master and the slave reach the EC_AL_OP_STATE, and the working counter is EC_WC_COMPLETE, as expected. However, all PDO readings remain zero, even though they clearly shouldn’t be.<o:p></o:p></p>
<p class="MsoNormal">I’ve used both the <i>ethercat update</i> command and TwinCAT to inspect the PDO register values, and there doesn't seem to be any initialization or control command required to "activate" the slave data. Yet, the values returned by
<i>ecrt_domain_process()</i> remain null.<o:p></o:p></p>
<p class="MsoNormal"><br>
Has anyone experienced a similar issue, perhaps related to fixed PDO mappings or placeholder entries? Could there be a detail I'm missing when using placeholders?<o:p></o:p></p>
<p class="MsoNormal"><br>
Any help or pointers to previous discussions would be greatly appreciated.<o:p></o:p></p>
<p class="MsoNormal">Thanks in advance for your time!<o:p></o:p></p>
<p class="MsoNormal">Best regards,<br>
<b><br>
</b>Filippo Zoffoli<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>