<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to VAR PERSISTENT RETAIN and how to shud down RPI</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/32cae6ec35/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/32cae6ec35/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/32cae6ec35/</id><updated>2020-02-27T16:07:53.675000Z</updated><subtitle>Recent posts to VAR PERSISTENT RETAIN and how to shud down RPI</subtitle><entry><title>VAR PERSISTENT RETAIN and how to shud down RPI</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/32cae6ec35/?limit=25#6a9c" rel="alternate"/><published>2020-02-27T16:07:53.675000Z</published><updated>2020-02-27T16:07:53.675000Z</updated><author><name>teichhei</name><uri>https://forge.codesys.com/u/teichhei/</uri></author><id>https://forge.codesys.com1a9832eef690dbc9e59d53486b9c7f541ffb09e7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;That's cool. Is there any other cool stuff like setting up Raspi Ethernet IP and gateway?&lt;br/&gt;
There is another good way to kind of deal with retains. When I have retains in the form of settings that don't change all the time, I write the retain file off to disk on change. And restore on a reboot. It's a problem though when the pi has to deal with frequently changing stuff like metering pulses.&lt;/p&gt;
&lt;p&gt;Sent from my SM-G935F using Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VAR PERSISTENT RETAIN and how to shud down RPI</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/32cae6ec35/?limit=25#5fc9" rel="alternate"/><published>2020-02-27T16:07:51.417000Z</published><updated>2020-02-27T16:07:51.417000Z</updated><author><name>johan76swart</name><uri>https://forge.codesys.com/u/johan76swart/</uri></author><id>https://forge.codesys.comd8692ac6ddb34bc9afe713b75fffeec20d3d4a8c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi mbruck,&lt;/p&gt;
&lt;p&gt;Yes it is possible to shutdown the pi form the program. See my example below.&lt;/p&gt;
&lt;p&gt;First you will need to import the SysProcess library in the library manager.&lt;br/&gt;
Second add these two variables in the variable editor.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;command1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then in the editor add these lines:&lt;/p&gt;
&lt;p&gt;You can replace the command1 variable with 'sudo reboot' for a reboot.&lt;/p&gt;
&lt;p&gt;You can even use it to run a python script in the background.&lt;br/&gt;
Nice and simple  &lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Johan&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: shutdown.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2936"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VAR PERSISTENT RETAIN and how to shud down RPI</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/32cae6ec35/?limit=25#1d94" rel="alternate"/><published>2020-02-27T16:07:50.620000Z</published><updated>2020-02-27T16:07:50.620000Z</updated><author><name>mbruck</name><uri>https://forge.codesys.com/u/mbruck/</uri></author><id>https://forge.codesys.com85e8c55e19eda82f258ad9c44cb98dbc9bc06f78</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;From here :&lt;br/&gt;
 l &lt;a class="" href="https://forum.codesys.com/viewtopic.php?t=5722&amp;amp;start=30&amp;amp;p=17138&amp;amp;lan=en" rel="nofollow"&gt;viewtopic.php?t=5722&amp;amp;start=30#p17138&lt;/a&gt; l &lt;/p&gt;
&lt;p&gt;There is statement:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
It works with a normal shutdown, but with a failure not.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
...if you want to use the "VAR PERSISTENT RETAIN" with the Pi and a have reliable solution&lt;br/&gt;
then a UPS is a must have!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, I have an UPS, but I'd like to shutdown my mashine and RPI after that.  As I understund it is posible to retain persistent variables if normal shutdown is afected.&lt;br/&gt;
My question is it possible to shutdown RPI from program ?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>