<div dir="ltr">Thanks. <div><br><div>I tried the second option (used ecrt_master_sdo_download) and it worked.</div><div><br></div><div>Best,</div><div>Mohsen</div><div><br><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 26, 2018 at 2:45 AM, Gavin Lambert <span dir="ltr"><<a href="mailto:gavin.lambert@tomra.com" target="_blank">gavin.lambert@tomra.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-NZ" link="#0563C1" vlink="#954F72">
<div class="m_4945324350381565130WordSection1">
<p class="MsoNormal"><span>There’s a number of different ways to do it, depending on why and how you want to do it.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>If this is a configuration setting (especially if it needs to be re-sent every time the slave reboots) that you can write (without needing to read anything), then you should use one of the ecrt_slave_config_sdo*()
methods. This will not do it immediately but will do it when you activate the master, and also if the slave reboots at any time while the master is active.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>If it’s a one-off request/query which you only do before activating the master, then you should use one of the ecrt_master_sdo_*() methods. This will execute immediately and wait for the response.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>If you want to do it while the master is active, then you can either call ecrt_master_sdo_*() from a separate (non-realtime) thread (at the cost of a little extra latency on the realtime cycle),
or you can use ecrt_slave_config_create_sdo_<wbr>request() and related methods to perform polling on the realtime thread (for some extra code complexity).<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>If it’s just something you need to do during commissioning and then never again (eg. if you can save the setting to the slave permanently), then you can use the “ethercat download” command.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></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<br>
<b>Sent:</b> Wednesday, 26 September 2018 03:41<br>
<b>To:</b> <a href="mailto:etherlab-users@etherlab.org" target="_blank">etherlab-users@etherlab.org</a><br>
<b>Subject:</b> [etherlab-users] Read from/write to the slave's object dictionary using SDOs<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Hello everyone.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">How can I read from or write to an entry of a slave's object dictionary using SDO? I'm going to do this before my real-time task. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">For example, I would like to set the value of 0x6040 to 15 before my cyclic task.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Best,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Mohsen<u></u><u></u></p>
</div>
</div>
</div>
</div></div></div>
</div>
</div>
</blockquote></div><br></div>