<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 12 (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:Tahoma;
panose-1:2 11 6 4 3 5 4 4 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;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.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=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Steve,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Typically you don’t need to worry about data overlaps at all. I’m not sure if the Etherlab master generates them in the first place (though your XML output suggests that it does), but even if it does it should only do so in cases when it is “safe”. (In particular, if you have a single slave with inputs and outputs, or you have an output-only slave followed by an input-only slave, then it’s possible to use the same physical memory in the EtherCAT packet to store both – once the output data is “used” by a slave that space in the packet is free to have input data filled in afterwards.)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regarding your confusion about ecrt_slave_config_reg_pdo_entry reporting values higher than ecrt_domain_size, this is because they are reporting different information. The former tells you where to read or write the values in master-internal memory to have them copied to the right place in the EtherCAT packet. The latter tells you the size of the data in the EtherCAT packet itself. Thus the former refers to the non-overlapped data and the latter refers to the overlapped data.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Just don’t worry about it, and use the offsets returned from reg_pdo_entry to read/write the data. The master library will do the right things to get that data to the slaves and back.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Gavin Lambert<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> etherlab-users-bounces@etherlab.org [mailto:etherlab-users-bounces@etherlab.org] <b>On Behalf Of </b>Steve Hartmann<br><b>Sent:</b> Thursday, 10 April 2014 09:52<br><b>To:</b> etherlab-users@etherlab.org<br><b>Subject:</b> Re: [etherlab-users] Domain offset overlap<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Another confusing thing I see is ecrt_slave_config_ret_pdo_entry() reports offsets as large as 10, but when I call ecrt_domain_size(), it reports a size of 7. Since the PD buffer is a pointer to uint8_t, I am assuming the size reported is in bytes.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Thanks,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Steven<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>From: </span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Steven Hartmann <<a href="mailto:shartmann@militho.com">shartmann@militho.com</a>><br><b>Date: </b>Wednesday, April 9, 2014 2:49 PM<br><b>To: </b>Dave Page <<a href="mailto:dave.page@gleeble.com">dave.page@gleeble.com</a>>, Etherlab Users <<a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a>><br><b>Subject: </b>Re: [etherlab-users] Domain offset overlap<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Hi Dave,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Thanks for the reply. I am not using TwinCAT at all. Also, please forgive my ignorance, but what is the "LRW command".<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>I'm not sure how to deal with this with the etherlab stack. If it give me a domain offset of 3 for two different slices (one input and one output), how do I deal with this overlapped data?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Thanks,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>Steven<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>From: </span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:black'>Dave Page <<a href="mailto:dave.page@gleeble.com">dave.page@gleeble.com</a>><br><b>Date: </b>Wednesday, April 9, 2014 2:45 PM<br><b>To: </b>Etherlab Users <<a href="mailto:etherlab-users@etherlab.org">etherlab-users@etherlab.org</a>><br><b>Subject: </b>Re: [etherlab-users] Domain offset overlap<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p></div><div><div><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><br> In order to reduce process data size, TwinCAT overlaps the RxPDO and TxPDO for each module, then uses the LRW command to effect the transfer. So, I believe what you're seeing is normal.<br><br> Best regards - Dave Page<br><br>On 09-Apr-14 15:41, <a href="mailto:etherlab-users-request@etherlab.org">etherlab-users-request@etherlab.org</a> wrote:<o:p></o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre><span style='color:black'>Message: 1<o:p></o:p></span></pre><pre><span style='color:black'>Date: Wed, 9 Apr 2014 19:41:29 +0000<o:p></o:p></span></pre><pre><span style='color:black'>From: Steve Hartmann <a href="mailto:shartmann@militho.com"><shartmann@militho.com></a><o:p></o:p></span></pre><pre><span style='color:black'>To: Etherlab Users <a href="mailto:etherlab-users@etherlab.org"><etherlab-users@etherlab.org></a><o:p></o:p></span></pre><pre><span style='color:black'>Subject: [etherlab-users] Domain offset overlap<o:p></o:p></span></pre><pre><span style='color:black'>Message-ID: <a href="mailto:CF6B0C97.F827%25shartmann@militho.com"><CF6B0C97.F827%shartmann@militho.com></a><o:p></o:p></span></pre><pre><span style='color:black'>Content-Type: text/plain; charset="us-ascii"<o:p></o:p></span></pre><pre><span style='color:black'><o:p> </o:p></span></pre><pre><span style='color:black'>Hi all,<o:p></o:p></span></pre><pre><span style='color:black'><o:p> </o:p></span></pre><pre><span style='color:black'>I have written some code to parse the generated XML file from "ethercat xml" and use that to configure the ethercat stack. The problem I am having is the output from ecrt_slave_config_ret_pdo_entry produces overlapped offsets. I also tried using ecrt_slave_config_reg_pdo_entry_pos with the same results. This is a very simple test rig that has one each of DO, DI, AO, and AI slices - all beckhoff. I have attached a file which includes the generated XML file, the code in question, and the log output. Does anyone know what I am doing wrong?<o:p></o:p></span></pre><pre><span style='color:black'><o:p> </o:p></span></pre><pre><span style='color:black'>Best regards,<o:p></o:p></span></pre><pre><span style='color:black'><o:p> </o:p></span></pre><pre><span style='color:black'>Steven Hartmann<o:p></o:p></span></pre></blockquote><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>-- <o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'><hr size=2 width="100%" align=center></span></div><p class=MsoNormal><span style='font-size:11.5pt;font-family:"Calibri","sans-serif";color:black'>David Page, Chief Embedded Architect<br>Dynamic Systems Inc.<br>PO Box 1234<br>Poestenkill, NY 12140<br>Telephone: +1 (518) 283-5350 | Fax: +1 (518) 283-3160 | <o:p></o:p></span></p></div></div></div></div></div></div></div></body></html>