<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/</id><updated>2025-05-19T05:26:52.340000Z</updated><subtitle>Recent posts to Retain / Persistent Variables in Codesys for Raspberry Pi</subtitle><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#8583" rel="alternate"/><published>2025-05-19T05:26:52.340000Z</published><updated>2025-05-19T05:26:52.340000Z</updated><author><name>kut69</name><uri>https://forge.codesys.com/u/kut69/</uri></author><id>https://forge.codesys.comb68cc6ece2239af4ef3b4302a2e4a9404bd84427</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I am interested in details about the .ret file in the filesystem. I have already a project where the file is used (write on demand, read by start) and I want to share it as 'default input' for test devices using the identical application.&lt;br/&gt;
Opening the .ret file content in a hex editor (I only use a single string retain var) I asked myself what the meaning of the first 24 bytes is. It neither contains a handle to the application nor a reference to the variable. Is this maybe a timestamp? Or a CRC/checksum?&lt;/p&gt;
&lt;p&gt;Regards, Thomas&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#c282" rel="alternate"/><published>2024-08-31T19:26:36.739000Z</published><updated>2024-08-31T19:26:36.739000Z</updated><author><name>pietrobalint</name><uri>https://forge.codesys.com/u/pietrobalint/</uri></author><id>https://forge.codesys.comb4526796029814e1a1a2b1f334fbf091eb37b09a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I created global persistent variables, and select "Update boot aplication" on download window and it seems to me that it works well. I replug the Raspberry Pi 5 power supply and the values holds they previous value. So I think no additional code needed. The solution is so simply.  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#fd61" rel="alternate"/><published>2024-08-31T09:47:24.348000Z</published><updated>2024-08-31T09:47:24.348000Z</updated><author><name>pietrobalint</name><uri>https://forge.codesys.com/u/pietrobalint/</uri></author><id>https://forge.codesys.com4a088f804146ff78b71f7c618a4f8e7f89e17158</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I made hardware reboot and it still not working. &lt;br/&gt;
I also tried Persistence Manager which need Application Composer Single License but Codesys support said that my runtime do not compatibile with it and it will avaiable in 2025 only. So I hope I will figured out how to use this code.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#8c80" rel="alternate"/><published>2024-08-20T07:43:49.022000Z</published><updated>2024-08-20T07:43:49.022000Z</updated><author><name>pietrobalint</name><uri>https://forge.codesys.com/u/pietrobalint/</uri></author><id>https://forge.codesys.com70b0bece0789f221a8b233175e1cc6fb47112935</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi micik,&lt;/p&gt;
&lt;p&gt;I am not sure I am using well the code, because I checked the directory and there is no retains.ret file.&lt;br/&gt;
Now I deleted the code from my project and the values are still works as persistant variables after ssh reboot it seems to me they retain as their previous value. So I am a bit confused, maybe  4.12.0.0 Raspberry Pi SL solved the persitent variable problem...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#d656" rel="alternate"/><published>2024-08-20T05:13:55.781000Z</published><updated>2024-08-20T05:13:55.781000Z</updated><author><name>micik</name><uri>https://forge.codesys.com/u/micik/</uri></author><id>https://forge.codesys.comb982fea890c1234b19f92048c30e3065f1401eec</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello pietrobalint,&lt;br/&gt;
could you please how exactly you call this program? if not in the main task? Caould you please share a screenshot of how exactly you made it work?&lt;br/&gt;
Thank you!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#bc1c" rel="alternate"/><published>2024-08-17T23:47:13.646000Z</published><updated>2024-08-17T23:47:13.646000Z</updated><author><name>pietrobalint</name><uri>https://forge.codesys.com/u/pietrobalint/</uri></author><id>https://forge.codesys.com6447cf6ab9731e5a672d51efe581239f9767a0c9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ok, I figured out that I do not call the program in the main task. &lt;br/&gt;
Thank you for the source code, it works!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#e55b" rel="alternate"/><published>2024-08-17T23:00:49.445000Z</published><updated>2024-08-17T23:00:49.445000Z</updated><author><name>pietrobalint</name><uri>https://forge.codesys.com/u/pietrobalint/</uri></author><id>https://forge.codesys.comc5c6aa1017af6d7d457e3b345c0890a7dbbeb44c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am very new in Codesys so let me apologize for my dumb question.&lt;br/&gt;
Could you explain how to impement this code mentioned before?&lt;/p&gt;
&lt;p&gt;Thank you very much!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#1e81/2271/b80f/3d78" rel="alternate"/><published>2022-05-09T06:20:13.082000Z</published><updated>2022-05-09T06:20:13.082000Z</updated><author><name>princessdvlk</name><uri>https://forge.codesys.com/u/princessdvlk/</uri></author><id>https://forge.codesys.com31c09be1d27a2a7dae50de5b511621cd6dfb9455</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
definitely. I will check it out.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#1e81/2271/b80f" rel="alternate"/><published>2022-04-14T12:37:45.688000Z</published><updated>2022-04-14T12:37:45.688000Z</updated><author><name>paulpotat</name><uri>https://forge.codesys.com/u/paulpotat/</uri></author><id>https://forge.codesys.com281ba150fe3393c08901ff0e7c837ec53cea6eed</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm glad it helped ! &lt;br/&gt;
Also you should check out this &lt;a class="" href="https://forge.codesys.com/forge/talk/Engineering/thread/e837426615/"&gt;post&lt;/a&gt;, there are other (maybe better) solutions for managing persistant variables :)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Retain / Persistent Variables in Codesys for Raspberry Pi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/05fa655d71/?limit=25#1e81/2271" rel="alternate"/><published>2022-04-14T10:50:03.853000Z</published><updated>2022-04-14T10:50:03.853000Z</updated><author><name>princessdvlk</name><uri>https://forge.codesys.com/u/princessdvlk/</uri></author><id>https://forge.codesys.comda54bfbd92f210cf25a67e5c55fcfe74e21d6681</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, &lt;br/&gt;
I tried your code and oh my god, you were right! It worked. YAY!&lt;br/&gt;
I am so glad it worked because I was trying hard for the past 4 days but nothing clicked. &lt;br/&gt;
However, I observed that to retain the changed values, the raspberry has to be shutdown properly instead of direct plug off. I mean when I directly turned off the supply and switched it back on, the pi showed me the previous values but not the changed ones. So, I shut it down properly and it worked!!&lt;br/&gt;
Thank you so much for sharing this critical piece of information and helping me out. &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>