<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to check whether one input is assigned a value?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/24452f3cb2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/24452f3cb2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/24452f3cb2/</id><updated>2020-02-27T20:34:13.479000Z</updated><subtitle>Recent posts to How to check whether one input is assigned a value?</subtitle><entry><title>How to check whether one input is assigned a value?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/24452f3cb2/?limit=25#f42a" rel="alternate"/><published>2020-02-27T20:34:13.479000Z</published><updated>2020-02-27T20:34:13.479000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com36d64119c332efe6b8a03e51f18122b9c21d35f2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;you cannot, because the variables stay in memory and the value is going to be what it was the last time.&lt;/p&gt;
&lt;p&gt;i was looking for something like this and my solution was the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;a default value outside the range of a normal value would show that the variable had not been set. this input value could then be overwritten anytime the function is called and you would know if the input was assigned or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;for example: and input in1 with the range of 0..100 as value range&lt;/p&gt;
&lt;p&gt;the function block itself has to make sure the input is always at a value outside the defined input range then it can decide if the input valkue has been set or not&lt;/p&gt;
&lt;p&gt;var_input&lt;/p&gt;
&lt;p&gt;in1 : real;&lt;/p&gt;
&lt;p&gt;end_var&lt;/p&gt;
&lt;p&gt;in in1 &amp;lt;= 100 then&lt;/p&gt;
&lt;p&gt;input := in1&lt;/p&gt;
&lt;p&gt;end_if;&lt;/p&gt;
&lt;p&gt;in1 := 99999;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to check whether one input is assigned a value?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/24452f3cb2/?limit=25#c21f" rel="alternate"/><published>2020-02-27T20:34:09.661000Z</published><updated>2020-02-27T20:34:09.661000Z</updated><author><name>andy2008</name><uri>https://forge.codesys.com/u/andy2008/</uri></author><id>https://forge.codesys.com7d75ae5df0bb7816fe099609d2dd48378e53f041</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, everyone,&lt;/p&gt;
&lt;p&gt;I have a function block with 3 inputs (IN1,IN2,IN3), but sometimes I call the function just with input of IN1, or IN2?&lt;/p&gt;
&lt;p&gt;For example: FB(IN1:=XX) or FB(IN2:=XX) or FB(IN1:=XX,IN2:=XX) etc.&lt;/p&gt;
&lt;p&gt;How can I know which input is assigned when the function block is called?&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>