<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Relatively new to Codesys and SFC</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/95ef90d783/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/95ef90d783/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/95ef90d783/</id><updated>2020-02-27T22:57:50.199000Z</updated><subtitle>Recent posts to Relatively new to Codesys and SFC</subtitle><entry><title>Relatively new to Codesys and SFC</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/95ef90d783/?limit=25#fda9" rel="alternate"/><published>2020-02-27T22:57:50.199000Z</published><updated>2020-02-27T22:57:50.199000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com6f36a5c09496097593a20b9205a025f9a85d1d94</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;The CoDeSys help should explain the variable types, but basically:&lt;/p&gt;
&lt;p&gt;VAR_INPUT = input variable to a POU (outside passing into your program or function or function block). You should not modify a var input inside your POU, but you can, but the outside programs cannot see it. So treat it as a read only...&lt;/p&gt;
&lt;p&gt;VAR_OUTPUT = output variable of a POU (your program passing out to an outside program or function or function block).  Treat as a write always. &lt;/p&gt;
&lt;p&gt;VAR = internal variables to your POU (outside POUs cannot or should not access these variables.  FBs and Functions hide VAR types but PROGRAMS do not. &lt;/p&gt;
&lt;p&gt;Declare initial values for variables like this:&lt;/p&gt;
&lt;p&gt;VAR&lt;br/&gt;
   MyBool : BOOL := True;&lt;br/&gt;
   MyCount : UINT := 27;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;You can declare like this for any var type (input, output..)&lt;/p&gt;
&lt;p&gt;Regarding SFC transitions, you can use complicated Boolean expressions or I think even method calls that return a Boolean. &lt;/p&gt;
&lt;p&gt;I don’t know why you have issues with the simulation mode.  Just make sure your POU is actually called by a program or task that is running - it is a common error to have a POU. It not actually call it...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Relatively new to Codesys and SFC</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/95ef90d783/?limit=25#44e4" rel="alternate"/><published>2020-02-27T22:57:48.590000Z</published><updated>2020-02-27T22:57:48.590000Z</updated><author><name>twdi</name><uri>https://forge.codesys.com/u/twdi/</uri></author><id>https://forge.codesys.com040ae465faf21e567ce607e533e9de9bfc25cec6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm using Codesys to learn PLC programming and now I have to make an assigment in SFC.&lt;/p&gt;
&lt;p&gt;First, I can't find an explanation about the different variable types. I see just VAR or VAR_INPUT etc.&lt;br/&gt;
What are the differences?&lt;/p&gt;
&lt;p&gt;Second, can I use logic in transitions like "bStart AND (seDockingUp AND seLidlifterOutwards)"?&lt;/p&gt;
&lt;p&gt;bStart is declared as &lt;strong&gt;VAR&lt;/strong&gt; and seDockingUp and seLidlifterOutwards are declared as &lt;strong&gt;VAR_INPUT&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;if I run a program with this transition in simulation mode, the program does not continue when I make them all &lt;strong&gt;TRUE&lt;/strong&gt;. I don't see why.  My idea is to reset the bStart in the next step. &lt;/p&gt;
&lt;p&gt;Where and how do I declare initial start values for specific booleans?&lt;/p&gt;
&lt;p&gt;Thanks for you help&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>