<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 12 (filtered medium)">
<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:"Helvetica Neue";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* 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;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.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,<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">I have never been able to get the EL7031 and EL7041 stepper modules to work in DC sync mode. I’ve also never really had enough time to really get in and figure
out why. If you do and succeed then it would be appreciated if you could post your results. You could perhaps try to get it working under a TwinCAT system then compare the differences.<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"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Some more notes on DC:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">- During your app setup, the first call to
</span><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">ecrt_master_application_time()</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> defines the “time when the clocks start off for the first time”.
Your realtime cycle must then be relative to this time once you go realtime.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">- There are two parts to DC. The first is the synchronization of the slaves clocks to the reference slaves clock (and the master clock). The second is choosing
which slaves use the dc sync events by calling </span><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D">ecrt_slave_config_dc()</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> on every slave you wish
to be sync’ed, but this can only be called on slaves that support DC to this level.<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"><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">Graeme.<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>
<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 [mailto:etherlab-users-bounces@etherlab.org]
<b>On Behalf Of </b>Paul Mulligan<br>
<b>Sent:</b> Wednesday, 2 March 2016 5:27 a.m.<br>
<b>To:</b> Richard Hacker; etherlab-users@etherlab.org<br>
<b>Subject:</b> Re: [etherlab-users] distributed clocks query<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div id="yiv7999484190">
<div id="yui_3_16_0_1_1456837771168_20076">
<div id="yui_3_16_0_1_1456837771168_20075">
<div id="yiv7999484190yui_3_16_0_1_1456837771168_18558">
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Helvetica Neue","serif";color:black">Thanks.<o:p></o:p></span></p>
</div>
<div id="yiv7999484190yui_3_16_0_1_1456837771168_18558">
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Helvetica Neue","serif";color:black"><o:p> </o:p></span></p>
</div>
<div id="yiv7999484190yui_3_16_0_1_1456837771168_18558">
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Helvetica Neue","serif";color:black">It seems the however that the EL7031 stepper motor module does not work in DC mode even tho the AssignActivate word is listed in the
device description xml file as 0x300. <o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1456837771168_20074">
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-size:10.5pt;font-family:"Helvetica Neue","serif";color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">On Tuesday, 1 March 2016, 17:04:39, Richard Hacker <<a href="mailto:ha@igh.de">ha@igh.de</a>> wrote:</span><span style="font-family:"Helvetica Neue","serif";color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica Neue","serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica Neue","serif";color:black">DC is quite an intricate aspect of EtherCAT.<br>
<br>
In DC enabled slaves, there are two clocks that generate events. You <br>
specify the time at which these clocks run as well as the time when the <br>
clocks start off for the first time. What the slave controller does at <br>
these events is implementation detail and must be documented by the <br>
manufacturer of the slave.<br>
<br>
There is documentation available at<br>
<a href="http://download.beckhoff.com/download/document/io/ethercat-terminals/ethercatsystem_en.chm" target="_blank">http://download.beckhoff.com/download/document/io/ethercat-terminals/ethercatsystem_en.chm</a><br>
Check out Distributed Clocks -> Slave synchronization -> DC Modes.<br>
<br>
In the master, it is configured using<br>
void ecrt_slave_config_dc(<br>
ec_slave_config_t *sc, /**< Slave configuration.*/<br>
uint16_t assign_activate, /**< AssignActivate word.*/<br>
uint32_t sync0_cycle, /**< SYNC0 cycle time [ns].*/<br>
int32_t sync0_shift, /**< SYNC0 shift time [ns].*/<br>
uint32_t sync1_cycle, /**< SYNC1 cycle time [ns].*/<br>
int32_t sync1_shift /**< SYNC1 shift time [ns].*/<br>
);<br>
<br>
You will be stetting sync0_cycle to your cycle time in nanoseconds and <br>
play around with sync0_shift somewhere half of your cycle time. The <br>
other values will be zero in your case (in fact, sync1_shift is not even <br>
used in the master!)<br>
<br>
To check whether your slave is synchronizing, run:<br>
<br>
watch -n0 "ethercat reg_read -pX -tsm32 0x92c"<br>
<br>
where X is the position of your slave. This value should be quite low, <br>
in the order of a few hundred. This is a correction value in nanoseconds <br>
of the slave's clock.<br>
<br>
On 01.03.2016 12:44, Paul Mulligan wrote:<br>
> Hi,<br>
><br>
> I'm still unsure as to what values are given for the last four<br>
> parameters of this function. I believe the sync1_cycle and sync1_shift<br>
> can be ignored but how is the sync0_shift value determined? I believe<br>
> the frame should reach all the slaves before this time but also the new<br>
> frame should not be received before this time. In the examples given, a<br>
> scan time of 1ms is used but the sync0_shift value is 4.4 ms. How can<br>
> this be correct?<br>
><br>
> ecrt_slave_config_dc(modules[index].sc, 0x0300, scanTime, ??, ??, ??, ??);<br>
><br>
><br>
> On Monday, 29 February 2016, 15:57:30, Richard Hacker <<a href="mailto:ha@igh.de" target="_blank">ha@igh.de</a>> wrote:<br>
><br>
><br>
> I only configure DC on the slaves that are actually required to be<br>
> synchronized.<br>
><br>
> Otherwise it seems correct what you are doing...<br>
><br>
> Am 2016-02-29 um 14:45 schrieb Paul Mulligan:<br>
> > Hi,<br>
> ><br>
> > Just a question or two about distributed clocks.<br>
> ><br>
> > I have a system with an EL1008 digital input module, EL3001 analogue<br>
> > input module, two EL7031 stepper motor driver modules and two EL2008<br>
> > digital output modules in that order. I am using the EK1100 bus coupler<br>
> > terminal as the first module.<br>
> ><br>
> > Do I need to call ecrt_slave_config_dc() for all of these modules before<br>
> > activating the master, or just the first module on the bus? My<br>
> > understanding from reading about distributed clocks is that the first<br>
> > module on the bus with DC capability should be used as the reference<br>
> clock.<br>
> ><br>
> > From looking at the example "dc_user" supplied in the master download,<br>
> > it calls ecrt_slave_config_dc() only for the IDS_COUNTER module.<br>
> ><br>
> > In the cyclic_task(), the functions ecrt_master_application_time(),<br>
> > ecrt_master_sync_reference_clock(), ecrt_master_sync_slave_clocks() are<br>
> > then called in that order. I notice ecrt_master_reference_clock_time()<br>
> > is not used at all here.<br>
> ><br>
> > Is this all that is required to control the distributed clocks ? Thank<br>
> > you in advance.<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > etherlab-users mailing list<br>
> > <a href="mailto:etherlab-users@etherlab.org" target="_blank">etherlab-users@etherlab.org</a> <mailto:<a href="mailto:etherlab-users@etherlab.org" target="_blank">etherlab-users@etherlab.org</a>><o:p></o:p></span></p>
<div id="yiv7999484190yqtfd29695">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica Neue","serif";color:black"><br>
> > <a href="http://lists.etherlab.org/mailman/listinfo/etherlab-users" target="_blank">
http://lists.etherlab.org/mailman/listinfo/etherlab-users</a><br>
> ><br>
><br>
><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica Neue","serif";color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>