<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to make the output of a function blok persistent?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d0996850b/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d0996850b/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3d0996850b/</id><updated>2020-11-09T06:16:38.097000Z</updated><subtitle>Recent posts to How to make the output of a function blok persistent?</subtitle><entry><title>How to make the output of a function blok persistent?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d0996850b/?limit=100#79c2" rel="alternate"/><published>2020-11-09T06:16:38.097000Z</published><updated>2020-11-09T06:16:38.097000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.come0ca8fd11a6a4d5a29399a8a0169a8a93eb63c3c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Using an inout variable will suit your requirements.&lt;br/&gt;
More generally, if you need to know the previous state of an output variable, then it should be an inout. Inout refers to variables you want to read and write.&lt;br/&gt;
Just define the inout variable as persistent.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to make the output of a function blok persistent?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3d0996850b/?limit=25#5afd" rel="alternate"/><published>2020-11-07T13:02:56.198000Z</published><updated>2020-11-07T13:02:56.198000Z</updated><author><name>benbammens</name><uri>https://forge.codesys.com/u/benbammens/</uri></author><id>https://forge.codesys.comc5303d5677ec5c854a98fc265d6fdbaca0f25f2d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I use a PFC200 with codesys for my home automation. I would like the light outputs to be persistent since it is a pain in the b... that every time when I re-upload the program or restart the PLC the lights go out... &lt;/p&gt;
&lt;p&gt;I use push buttons an a toggle function block to control the lights. I have made the final output variable persistent, but when the program starts, the output "Q" of the toggle FB gets reset ofcourse and the light is switched off. &lt;/p&gt;
&lt;p&gt;I have tried to define the entire block as retain variable but this does not seem to work. I cannot define the "Q" as retained in my POU since it is part of the FB... &lt;/p&gt;
&lt;p&gt;Is there an easy way to set this up? &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>