<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to FUnction Block calling in ST</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0bdf504569/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0bdf504569/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0bdf504569/</id><updated>2020-02-27T22:19:37.929000Z</updated><subtitle>Recent posts to FUnction Block calling in ST</subtitle><entry><title>FUnction Block calling in ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0bdf504569/?limit=25#171e" rel="alternate"/><published>2020-02-27T22:19:37.929000Z</published><updated>2020-02-27T22:19:37.929000Z</updated><author><name>xwalter</name><uri>https://forge.codesys.com/u/xwalter/</uri></author><id>https://forge.codesys.com104b4003732eb3e21f8db28d979cfff3105a1fef</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ok i have discovered &lt;/p&gt;
&lt;p&gt;To call the FB in ST it need to use the name of the instance and then pass the parameters &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>FUnction Block calling in ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0bdf504569/?limit=25#ce6a" rel="alternate"/><published>2020-02-27T22:19:36.366000Z</published><updated>2020-02-27T22:19:36.366000Z</updated><author><name>xwalter</name><uri>https://forge.codesys.com/u/xwalter/</uri></author><id>https://forge.codesys.com0402d64d8afef0b048c8491ba79b61528300558f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hi to everybody .&lt;/p&gt;
&lt;p&gt;I would like to understand the following thing , i have a simple program i'm starting just now with the fantastic codesys .&lt;/p&gt;
&lt;p&gt;In my program i have :&lt;/p&gt;
&lt;p&gt;1) Main -Prg  ----&amp;gt; Structured text &lt;/p&gt;
&lt;p&gt;2) FB1          ----&amp;gt; Structured text&lt;/p&gt;
&lt;p&gt;The FB1 is simple , it only has 2 input parameter declared in its table &lt;/p&gt;
&lt;p&gt;ADD1-----INT &lt;/p&gt;
&lt;p&gt;ADD2-----INT&lt;/p&gt;
&lt;p&gt;and 1 output parameter &lt;/p&gt;
&lt;p&gt;SUM ------INT &lt;/p&gt;
&lt;p&gt;Difficult to understand that this FB get 2 integer numebers and calculate the sum and return it at output parameter .&lt;/p&gt;
&lt;p&gt;Up to now doesn't matter .&lt;/p&gt;
&lt;p&gt;In the Main-Prg i want to  call this FB1 .&lt;/p&gt;
&lt;p&gt;So i write &lt;/p&gt;
&lt;p&gt;FB1(ADD1:=2,ADD2:=2,SUM=&amp;gt;myINT) ; //myINT is declared in the table as VAR .&lt;/p&gt;
&lt;p&gt;In the VAR table of Main-Prg i declare also the instance for FB1 as follow:&lt;/p&gt;
&lt;p&gt;DB_FB1 ---- FB1 .&lt;/p&gt;
&lt;p&gt;I compile all but an event occours .&lt;/p&gt;
&lt;p&gt;Normally , in the SCL (ST in simatic system) , when i call an FBxx i write &lt;/p&gt;
&lt;p&gt;dot "name of instance like this ----- FB1.DB_FB1(........,....,,....);&lt;/p&gt;
&lt;p&gt;But codesys doesn't like of course.&lt;/p&gt;
&lt;p&gt;If i use an other language in Main-Prg it's so easy to write the instance over the box , but in ST i don't understand what to do ....&lt;/p&gt;
&lt;p&gt;Can somebody tell me the right solution ?&lt;/p&gt;
&lt;p&gt;Thanks so much &lt;/p&gt;
&lt;p&gt;Walter&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>