<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CANOpen Device - retaining SDOs</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/</id><updated>2022-09-29T15:09:29.981000Z</updated><subtitle>Recent posts to CANOpen Device - retaining SDOs</subtitle><entry><title>CANOpen Device - retaining SDOs</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/?limit=25#ce02" rel="alternate"/><published>2022-09-29T15:09:29.981000Z</published><updated>2022-09-29T15:09:29.981000Z</updated><author><name>juha-herrala</name><uri>https://forge.codesys.com/u/juha-herrala/</uri></author><id>https://forge.codesys.coma9a118b061f871e7bdc41d6f5bdd1af8d1157617</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I did not find the answer informative. I have the same problem: I would like to configure my CR711S standard side CANopen device parameters by using CANopen SDO. I can write the variables and read them. The device answers also to save commands 0x1010:1 and 3 with ack but every time I reboot the parameter is not stored&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen Device - retaining SDOs</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/?limit=25#754a" rel="alternate"/><published>2021-02-16T08:52:52.967000Z</published><updated>2021-02-16T08:52:52.967000Z</updated><author><name>alexey</name><uri>https://forge.codesys.com/u/alexey/</uri></author><id>https://forge.codesys.com317ed6126cd104273ec1ca012c94e4bb944380d0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi eschwellinger! Thank you for reply, I always use method described above. I am using IFM CR710S combined Standard/Safety PLC and this code sits on Safety PLC side. I think the problem is that safe retain GVL, safe PLC_PRG, non-safe PLC_PRGs and CANOpen Slave Device stack on Safety PLC have either different starting sequences OR non-safe PRG (to which I am only allowed to map CANOpen Slave Device variables) are randomly "floating" within task time because safe data processing takes highest priority. So I decided to move communication and retain processing code from Safety PLC to Standard PLC. Will see how it will go.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen Device - retaining SDOs</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/?limit=25#9747" rel="alternate"/><published>2021-02-16T07:47:23.495000Z</published><updated>2021-02-16T07:47:23.495000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com9aab690d372234cbe88d5638e6aaf4b222660880</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Alexey,&lt;/p&gt;
&lt;p&gt;Without having the application it's a little bit difficult to help.&lt;br/&gt;
But I would suppose that it's a problem in initialization order.&lt;br/&gt;
When the program starts, first of all the retains are initialized.&lt;br/&gt;
Then the CANopen Slave stack starts and writes the default (which you configured before in the editor) to the object dictionary.&lt;br/&gt;
This of course overwrites your retain value. The CANopen slave stack does not know that the object is mapped to a retain variable.&lt;br/&gt;
There are different possible solutions which depend on your specific use case:&lt;br/&gt;
1. Setting the default value in object dicitionary configurator&lt;br/&gt;
The CANopen Slave then awakes with this default value and it is also part of the EDS file. OR&lt;br/&gt;
2. Do not map a retain variable to the object and backup the value of the object to a retain variable.&lt;br/&gt;
So you could for example read the object in PLC_PRG and copy the value to a retain variable (the polling method). &lt;br/&gt;
Or you could register to the write event of the object dictionary and backup the value to a retain variable in write event (the event method).&lt;br/&gt;
In first PLC cycle you could copy the retain variable back to the object dictionary by using WriteObjectByAddress.&lt;br/&gt;
With this solution the retain variable is independent from CANopenSlave stack and will not be overwritten.&lt;br/&gt;
Of course the retain value is not part of the EDS file. But this is the same behaviour like for any off-shelf slave out there. &lt;br/&gt;
The EDS file always contains the off-shelf default values. Never the last stored value.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CANOpen Device - retaining SDOs</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e6d1d7c4b8/?limit=25#73eb" rel="alternate"/><published>2021-02-15T11:22:39.818000Z</published><updated>2021-02-15T11:22:39.818000Z</updated><author><name>alexey</name><uri>https://forge.codesys.com/u/alexey/</uri></author><id>https://forge.codesys.comb505668c4929df8c26bdd5170c3e6ec26726f19f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;GDay guys! I playing with CANOpen Slave Device in CoDeSys 3.5.11.0 and trying to achieve behaviour of any off-the-shelf CANOpen slave device (encoder, inclinometer, etc...) inside CoDeSys, particularly with SDOs. Usually then you use any CANOpen configuration software (e.g. IFM Maintenance) to change SDO parameter of any CANOpen slave, the change is either automatically retained OR you should write "SAVE" string to 0x1010h and power cycle device.&lt;/p&gt;
&lt;p&gt;Unfortunately I could not achieve similar behaviour inside CoDeSys. Please see a picture attached.&lt;/p&gt;
&lt;p&gt;&lt;img src="./attachment/attachment.png" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;I was trying to map SDO variable directly to persistent retain global variable list, but every time I reboot PLC, my variable is reinitialised with default value "10" from the object dictionary. I've also tried to map this SDO value to a volatile memory variable and overwrite it with retained value in external program using CAA CIA 405 library as well as CANopen_Device.ObjectDictionary.WriteObjectByAddress(...) and CANOpen_device.ObjectDictionary.ReadObjectByAddress methods during main program initialization. Nothing works!&lt;/p&gt;
&lt;p&gt;Any suggestions how to fix this issue? &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>