<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to PersistentVars RPi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/</id><updated>2022-01-27T09:44:49.224000Z</updated><subtitle>Recent posts to PersistentVars RPi</subtitle><entry><title>PersistentVars RPi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/?limit=25#3ce1/7141" rel="alternate"/><published>2022-01-27T09:44:49.224000Z</published><updated>2022-01-27T09:44:49.224000Z</updated><author><name>matthew</name><uri>https://forge.codesys.com/u/matthew/</uri></author><id>https://forge.codesys.comdd4c41205ac685edfcc4da92e7846ab8a68300d5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm still working on this, but if you use the code here&lt;br/&gt;
&lt;a href="https://forge.codesys.com/forge/talk/Engineering/thread/1f8eee253c/"&gt;https://forge.codesys.com/forge/talk/Engineering/thread/1f8eee253c/&lt;/a&gt; &lt;br/&gt;
I'm using a struct to store all my different variables and then using the pointer to the struct memory location and then setting the data length greater than what is in the struct. My plan is to modify the FB so it automatically reads the length of the data and so you can assign the struct directly to it. Have not had time to do this yet. &lt;br/&gt;
Your next issue will be the SD card getting corrupt from the sudden power loss, the best way to try prevent this is to use a read only file system for the OS. I have not tried this yet and will be giving it a go soon.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>PersistentVars RPi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/?limit=25#3ce1" rel="alternate"/><published>2022-01-27T09:00:46.022000Z</published><updated>2022-01-27T09:00:46.022000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com64bd81272ef9fddb82e0a6133149cef94185511d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;so, what should I do on event the power failure  to keep my values ? &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>PersistentVars RPi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/?limit=25#2ec7/94f7" rel="alternate"/><published>2022-01-27T00:27:00.107000Z</published><updated>2022-01-27T00:27:00.107000Z</updated><author><name>matthew</name><uri>https://forge.codesys.com/u/matthew/</uri></author><id>https://forge.codesys.com6d6ac3e3c9e2beb9fa3a3a4053127428a1b833ff</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Damian,&lt;/p&gt;
&lt;p&gt;Have a read through this &lt;a href="https://forge.codesys.com/forge/talk/Engineering/thread/74485fd9ed/"&gt;https://forge.codesys.com/forge/talk/Engineering/thread/74485fd9ed/&lt;/a&gt; hopefully it puts you on the right track. It's because they only get saved with a clean shutdown. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>PersistentVars RPi</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aa5288b1e3/?limit=25#2ec7" rel="alternate"/><published>2022-01-26T09:24:52.012000Z</published><updated>2022-01-26T09:24:52.012000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.com4ecfeca9547c5c2552ca1f79ae7623786920abd9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I need one variable and array to writę, read during program working and remember them after  power failure, so I create Persistentvars:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;{attribute 'qualified_only'}&lt;/span&gt;
&lt;span class="err"&gt;VAR_GLOBAL PERSISTENT RETAIN&lt;/span&gt;
&lt;span class="err"&gt;    mem_trans_arr: ARRAY[0..99, 0..1] OF STRING;   &lt;/span&gt;
&lt;span class="err"&gt;    id_trans:BYTE;&lt;/span&gt;
&lt;span class="err"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Read and write form my PLC_PRG works fine. But after restart/ turn off my RPi and run my variable and array are empty , why ?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>