<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Get name of EthercatTree device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b600451839/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b600451839/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b600451839/</id><updated>2022-03-30T17:02:59.267000Z</updated><subtitle>Recent posts to Get name of EthercatTree device</subtitle><entry><title>Get name of EthercatTree device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b600451839/?limit=25#66b4" rel="alternate"/><published>2022-03-30T17:02:59.267000Z</published><updated>2022-03-30T17:02:59.267000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com60e85ffca47848822a687b83e8ab2f5be285d959</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;An option is to add the "application composer - device diagnosis". This will generate code including a textlist containing the names of the devices.&lt;/p&gt;
&lt;p&gt;See:&lt;br/&gt;
&lt;a href="https://help.codesys.com/webapp/ac_device_diagnose_overview;product=core_Application_Composer;version=3.5.17.0" rel="nofollow"&gt;https://help.codesys.com/webapp/ac_device_diagnose_overview;product=core_Application_Composer;version=3.5.17.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After configuring this module and generating the code, you can then get the name of all devices:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DeviceDiagnosis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uiNumDDIs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;THEN&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;FOR&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DeviceDiagnosis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uiNumDDIs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DO&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;g_DDGInfos&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;THEN&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;sName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;g_DDGInfos&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pName&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;END_IF&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;END_FOR&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;END_IF&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Get name of EthercatTree device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b600451839/?limit=25#b73c" rel="alternate"/><published>2022-03-22T17:28:56.683000Z</published><updated>2022-03-22T17:28:56.683000Z</updated><author><name>plc11</name><uri>https://forge.codesys.com/u/plc11/</uri></author><id>https://forge.codesys.comda3e8854d1464abdbff99c66fd43200611efed2b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everybody,&lt;br/&gt;
I need to get the name of each device in the EtherCAT device tree and save it to a string in case it goes wrong. Is there any method? I actually can access to the ETCSlave_Diag of each device but with this seems there is no way to get the name.&lt;br/&gt;
Any suggestion?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>