<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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@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;
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.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:12.0pt;
font-family:"Times New Roman",serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:EN-NZ;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@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;mso-fareast-language:EN-US'>No, you don’t need to write any kernel code, that’s already there.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>The send/receive callbacks are mainly for use with RTAI or Xenomai implementations where the application is implemented in a super-kernel layer. You don’t need to use them for a userspace application.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'><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 #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'> Ruika You [mailto:crazylinuxcnc@gmail.com] <br><b>Sent:</b> Saturday, 6 May 2017 02:53<br><b>To:</b> Gavin Lambert <gavin.lambert@compacsort.com><br><b>Cc:</b> etherlab-users@etherlab.org<br><b>Subject:</b> Re: [etherlab-users] how to implement EoE example?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Thanks for your reply.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You mean I no need to write kernel module for EoE, even though EoE is kernel module of ethercat master. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I found some useful information from follow post:<o:p></o:p></p></div><div><p class=MsoNormal><<i><u><a href="https://www.mail-archive.com/etherlab-users@etherlab.org/msg01559.html">https://www.mail-archive.com/etherlab-users@etherlab.org/msg01559.html</a></u></i>><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>As Thomas Bitsky, Jr. comment:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><pre style='white-space:pre-wrap;word-wrap:break-word'><span style='font-size:10.5pt;font-family:Courier;color:black'>void<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>send_callback(void *cb_data)<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>{<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>ec_master_t *m = (ec_master_t *) cb_data;<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'> down(&master_sem);<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>ecrt_master_send_ext(m);<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'> up(&master_sem);<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>}<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'><o:p> </o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>void<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>receive_callback(void *cb_data)<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>{<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>ec_master_t *m = (ec_master_t *) cb_data;<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'> down(&master_sem);<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>ecrt_master_receive(m);<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'> up(&master_sem);<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'> }<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'><o:p> </o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>If they are not in the program and activated by ecrt_master_callbacks, then<o:p></o:p></span></pre><pre><span style='font-size:10.5pt;font-family:Courier;color:black'>there is no lock-up. Of course, EoE doesn't work.<o:p></o:p></span></pre></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I will add code into user space application and give a try. But I confused that how can I send data and receive data if there is no call back function?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks!<o:p></o:p></p></div><div><p class=MsoNormal>-chengxi <o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Fri, May 5, 2017 at 7:27 AM, Gavin Lambert <<a href="mailto:gavinl@compacsort.com" target="_blank">gavinl@compacsort.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>I don’t use EoE myself, but as I understand it the kernel component of the master (which exists even if your application is only in userspace) creates regular Linux ethernet devices for the EoE ports of the slaves, and takes care of the message relaying itself. So your application doesn’t need to do anything special and the userspace application (or any other process on the PC) can send packets to those devices just like any other network interface. You might need to assign it a static IP before regular apps will talk to it, though.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> </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 style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><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 [mailto:<a href="mailto:etherlab-users-bounces@etherlab.org" target="_blank">etherlab-users-bounces@etherlab.org</a>] <b>On Behalf Of </b>Ruika You<br><b>Sent:</b> Friday, 5 May 2017 02:45<br><b>To:</b> <a href="mailto:etherlab-users@etherlab.org" target="_blank">etherlab-users@etherlab.org</a><br><b>Subject:</b> [etherlab-users] how to implement EoE example?</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Dear all,<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Recently I am trying to implement EoE and do read all threads related EoE in this mailing list.But I still do not understand well.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>First of all, If I am not wrong EoE only works in kernel space? Unfortunatelly, currently my application works in user space. So in this case, I had better to run two master one in user space with current application, another one in kernel space with EoE?<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Secondly, if anyone have experience with EoE, would you mind share one example?<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Now I can start EoE and ping through eoe between two machines. I am not clear how to send data and receive data, like tty serial example? but El6614 does not have .xml file.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Any hints are appreciated.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks very much! <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div></div></div></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>