<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:"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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-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;}
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:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{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="mso-fareast-language:EN-US">That looks fine as far as it goes, but you do need to run the cyclic loop after calling ecrt_master_activate. That kicks off the configuration process but it requires several cycles to complete
and actually transition the slaves to OP.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">And once your application exits, the master will automatically deactivate and return the slaves to PREOP.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="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">From:</span></b><span lang="EN-US"> Mohsen Alizadeh Noghani <m.alizad3h@gmail.com>
<br>
<b>Sent:</b> Monday, 1 October 2018 22:09<br>
<b>To:</b> Gavin Lambert <gavin.lambert@tomra.com>; etherlab-users@etherlab.org<br>
<b>Subject:</b> Re: [etherlab-users] API for enabling/disabling sync managers of a slave<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">I still haven't been able to enable sync managers (and thus change the state to SAFEOP)<o:p></o:p></p>
</div>
<p class="MsoNormal">Currently, I'm executing <a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmohse-n%2FL7N_EtherLab%2Fblob%2Fmaster%2Fsimple_test.c&data=02%7C01%7Cgavin.lambert%40tomra.com%7Cde4676633de44877b14b08d6277d949a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C0%7C636739817661893040&sdata=L9ZYnno%2FqdrZNpqI7Zp02Xglc8dUybnVKy%2BnXniYeik%3D&reserved=0">
this code</a>, which is basically the user example.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Output of $ethercat xml of the slave is:<br>
<br>
<?xml version="1.0" ?><br>
<EtherCATInfo><br>
<!-- Slave 0 --><br>
<Vendor><br>
<Id>30101</Id><br>
</Vendor><br>
<Descriptions><br>
<Devices><br>
<Device><br>
<Type ProductCode="#x00000000" RevisionNo="#x00000002">L7N</Type><br>
<Name><![CDATA[L7N]]></Name><br>
<Sm Enable="1" StartAddress="#x1000" ControlByte="#x26" DefaultSize="128" /><br>
<Sm Enable="1" StartAddress="#x1400" ControlByte="#x22" DefaultSize="128" /><br>
<Sm Enable="0" StartAddress="#x1800" ControlByte="#x24" DefaultSize="0" /><br>
<Sm Enable="0" StartAddress="#x1c00" ControlByte="#x20" DefaultSize="0" /><br>
<RxPdo Sm="2" Fixed="1" Mandatory="1"><br>
<Index>#x1601</Index><br>
<Name>2nd Receive PDO Mapping</Name><br>
<Entry><br>
<Index>#x6040</Index><br>
<SubIndex>0</SubIndex><br>
<BitLen>16</BitLen><br>
<Name>Controlword</Name><br>
<DataType>UINT16</DataType><br>
</Entry><br>
<Entry><br>
<Index>#x607a</Index><br>
<SubIndex>0</SubIndex><br>
<BitLen>32</BitLen><br>
<Name>Target Position</Name><br>
<DataType>UINT32</DataType><br>
</Entry><br>
</RxPdo><br>
<TxPdo Sm="3" Fixed="1" Mandatory="1"><br>
<Index>#x1a01</Index><br>
<Name>2nd Transmit PDO Mapping</Name><br>
<Entry><br>
<Index>#x6041</Index><br>
<SubIndex>0</SubIndex><br>
<BitLen>16</BitLen><br>
<Name>Statusword</Name><br>
<DataType>UINT16</DataType><br>
</Entry><br>
<Entry><br>
<Index>#x6064</Index><br>
<SubIndex>0</SubIndex><br>
<BitLen>32</BitLen><br>
<Name>Position Actual Value</Name><br>
<DataType>UINT32</DataType><br>
</Entry><br>
</TxPdo><br>
</Device><br>
</Devices><br>
</Descriptions><br>
</EtherCATInfo><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Sep 26, 2018 at 3:02 AM Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com">gavin.lambert@tomra.com</a>> wrote:<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">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">You typically don’t need to explicitly disable a sync manager; you simply don’t refer to it or any PDOs it contains, and then it will not be included in the domain’s data.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Alternatively, you can configure the sync manager but then list zero PDOs for it, to explicitly set the PDO Assign register for that SM to 0 (for slaves that support flexible assignment).
Note that you should not enable the SM watchdog if you’re setting it to have zero PDOs.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It sounds like you should probably read the documentation for the EtherCAT protocol and for the Etherlab master in particular.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <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">From:</span></b><span lang="EN-US"> Mohsen Alizadeh Noghani <<a href="mailto:m.alizad3h@gmail.com" target="_blank">m.alizad3h@gmail.com</a>>
<br>
<b>Sent:</b> Wednesday, 26 September 2018 04:52<br>
<b>To:</b> Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com" target="_blank">gavin.lambert@tomra.com</a>>;
<a href="mailto:etherlab-users@etherlab.org" target="_blank">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> Re: [etherlab-users] API for enabling/disabling sync managers of a slave</span><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"><span style="font-size:9.5pt">Thanks Gavin.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">1- Would</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">ecrt_slave_config_sync_manager(sc, 2, EC_DIR_OUTPUT, EC_WD_ENABLE )</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">enable Sync Manager 2 of slave sc?</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">2- How can I disable it then? I doesn't seems the function provides an option to enable/disable.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">Best,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">Mohsen</span><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"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Tue, Sep 25, 2018 at 2:40 AM, Gavin Lambert <<a href="mailto:gavin.lambert@tomra.com" target="_blank">gavin.lambert@tomra.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-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">You need to write an application, and then use ecrt_slave_config_sync_manager or ecrt_slave_config_pdos to configure the Sync Managers for each slave.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <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">From:</span></b><span lang="EN-US"> Mohsen Alizadeh Noghani<br>
<b>Sent:</b> Tuesday, 25 September 2018 02:29<br>
<b>To:</b> <a href="mailto:etherlab-users@etherlab.org" target="_blank">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> [etherlab-users] API for enabling/disabling sync managers of a slave</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">Hello everyone.<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>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is there a function call that I can use for enabling a particular sync manager of a slave?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">For example, I'd like to enable sync manager 2 of slave 1.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
Best,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Mohsen<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>