<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/</id><updated>2020-02-27T14:06:02.536000Z</updated><subtitle>Recent posts to CANOpen; Change node id runtime (from PLC side)</subtitle><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#c373" rel="alternate"/><published>2020-02-27T14:06:02.536000Z</published><updated>2020-02-27T14:06:02.536000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comfd559879eaa8c000b3a4589f7e14bc1e769a779f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Edwin,&lt;br/&gt;
i would not recommend to write directly from the application &lt;br/&gt;
into these structures/fbs. What happens if 3S changes this fb/structures (for example with a new version). -&amp;gt;Your application will not work.&lt;br/&gt;
Recommend to wait till this jira (tracker database) is fixed.&lt;br/&gt;
E.Schwellinger&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#2476" rel="alternate"/><published>2020-02-27T14:06:01.581000Z</published><updated>2020-02-27T14:06:01.581000Z</updated><author><name>chab</name><uri>https://forge.codesys.com/u/chab/</uri></author><id>https://forge.codesys.combe6220f9046c4d88b090db137c6505fac921fad4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;With CoDeSys V3:&lt;/p&gt;
&lt;p&gt;I detected that a lot of internal variables of the CANOpen_Manager instance are available for read access.&lt;/p&gt;
&lt;p&gt;For example:&lt;br/&gt;
fpCOM := ADR(CANOpen_Manager_COM);&lt;br/&gt;
COM_m_eBusState    := fpCOM^.m_eBusState;&lt;br/&gt;
COM_m_bBusAlarm    := fpCOM^.m_bBusAlarm;&lt;br/&gt;
COM_m_bBusError    := fpCOM^.m_bBusError;    &lt;/p&gt;
&lt;p&gt;Maybe here the node id is available for read / write also. I have to check...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#08ec" rel="alternate"/><published>2020-02-27T14:06:01.179000Z</published><updated>2020-02-27T14:06:01.179000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.coma6ed984cca25967b0172b446310b0210372fe61d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm sorry I really have to pay attention to the forum where this was post which was V3. No this is only available in V23.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#d088" rel="alternate"/><published>2020-02-27T14:06:00.844000Z</published><updated>2020-02-27T14:06:00.844000Z</updated><author><name>chab</name><uri>https://forge.codesys.com/u/chab/</uri></author><id>https://forge.codesys.comb423d60cddabe733efa6667cfaf3036843a85b8e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Steve,&lt;br/&gt;
Thank you.&lt;br/&gt;
Are the array structure pCanOpenNode or the constant MAX_NODEINDEX available in CoDeSys V3?&lt;br/&gt;
At compile time, I get errors.&lt;br/&gt;
I use the CANOpen devices from 3S: CAN Local Device and CANOpen Manager. With CoDeSys V3.4 SP4 Patch 1.&lt;br/&gt;
Ed.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#2a22" rel="alternate"/><published>2020-02-27T14:06:00.463000Z</published><updated>2020-02-27T14:06:00.463000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.comb1f9bd1c7922adbde40d583c0c112d7506918300</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I think you might be able to do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Look at pCanOpenNode&lt;span&gt;[sIndex]&lt;/span&gt;.ucNodeNr . This is the global array that is built from the CANopenmanger windows that you configure the nodes with before build in CoDeSys. Note every time you add a new eds file you will have more Indexs of the pCanOpenNode array, so the indexs can change if you move eds files around. You can find this variable in the CanOpen implicit Variables Global POU when you are online with the PLC when running (To see the data).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you can write to pCanOpenNode&lt;span&gt;[sIndex]&lt;/span&gt;.ucNodeNr, it might be read only &lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="c"&gt;(* Scan the nodes and look for the node ID you want to change MAX_NODEINDEX is a global constant generated by CoDeSys*)&lt;/span&gt;
&lt;span class="n"&gt;FOR&lt;/span&gt; &lt;span class="n"&gt;sEachNode&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;MAX_NODEINDEX&lt;/span&gt; &lt;span class="n"&gt;DO&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="n"&gt;pCanOpenNode&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sEachNode&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="n"&gt;ucNodeNr&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;uold_node_id&lt;/span&gt; &lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="n"&gt;THEN&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;pCanOpenNode&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sIndex&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="n"&gt;ucNodeNr&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;unew_node_id&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="c"&gt;(* sudo code *)&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;reset_can_stack&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;END_IF&lt;/span&gt;
&lt;span class="n"&gt;END_FOR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;then you would have to perform a reset of the can stack in order for the changes to take effect. If you reset the whole PLC the changes will be gone.&lt;/p&gt;
&lt;p&gt;I'm not sure how to reset the CAN stack.&lt;/p&gt;
&lt;p&gt;You would have to put this in some initialization code.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#de1f" rel="alternate"/><published>2020-02-27T14:05:59.279000Z</published><updated>2020-02-27T14:05:59.279000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comded0dd543b17b0d1fc79cbdc0d4b183b3bfb3ddd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hello,&lt;br/&gt;
there is already an entry in your database&lt;br/&gt;
CDS-19465 for this improvement&lt;br/&gt;
cu&lt;br/&gt;
Edi&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen; Change node id runtime (from PLC side)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7f1b67fd2/?limit=25#6b47" rel="alternate"/><published>2020-02-27T14:05:58.842000Z</published><updated>2020-02-27T14:05:58.842000Z</updated><author><name>chab</name><uri>https://forge.codesys.com/u/chab/</uri></author><id>https://forge.codesys.com51382d4a9dc0e25030ead7325cceb995d12778f8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I wonder if I can change the node id of a local CANOpen device, in runtime. &lt;br/&gt;
The goal is to change the node id of a local CANOpen device that is in the PLC's device tree.&lt;br/&gt;
In the device tree I can set the node id before compiling and downloading. But I want to change the node id when the PLC is running!&lt;br/&gt;
The CANOpen devices I use are from 3S: CAN Local Device and CANOpen Manager.&lt;/p&gt;
&lt;p&gt;The topic "Changin of Node ID" ( l &lt;a class="" href="http://forum-en.3s-software.com/viewtopic.php?f=1&amp;amp;t=1224" rel="nofollow"&gt;viewtopic.php?f=1&amp;amp;t=1224&lt;/a&gt; l ) did not give an answer.&lt;br/&gt;
It is focused on the CANBus side. I'm looking for the CoDeSys side. Espesially ST code.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>