<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Converting a program into a function block</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c7158787c5/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c7158787c5/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c7158787c5/</id><updated>2020-02-27T22:45:27.927000Z</updated><subtitle>Recent posts to Converting a program into a function block</subtitle><entry><title>Converting a program into a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/c7158787c5/?limit=25#23da" rel="alternate"/><published>2020-02-27T22:45:27.927000Z</published><updated>2020-02-27T22:45:27.927000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com7bb40cebebf75a061851488b63f967643eac4ba9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;not correct , as a program has no I/O defined.&lt;br/&gt;
however it is possible to do:&lt;/p&gt;
&lt;p&gt;copy the program and give it other name (something like FB_SFC_blabla)&lt;br/&gt;
change indeed the name program to Function_block&lt;br/&gt;
now define what variables are used as Input&lt;br/&gt;
and as Output and which ones are global and local etc.&lt;br/&gt;
within the program no changes are needed.&lt;br/&gt;
check the real I/O Tags as you will mess it up when using double.&lt;/p&gt;
&lt;p&gt;It is normal for a beginner to do it this way.&lt;br/&gt;
I only use Function blocks and my main program just calls blocks. so my main program is max one page, same for a sub btw make them max one page so you can overview what happens.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Converting a program into a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/c7158787c5/?limit=25#26fb" rel="alternate"/><published>2020-02-27T22:45:26.250000Z</published><updated>2020-02-27T22:45:26.250000Z</updated><author><name>tonypdean</name><uri>https://forge.codesys.com/u/tonypdean/</uri></author><id>https://forge.codesys.comd676c52356e86edc1220a08a50a792f02f57e9d1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks very much for your reply, I will try this.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Converting a program into a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/c7158787c5/?limit=25#69e3" rel="alternate"/><published>2020-02-27T22:45:21.444000Z</published><updated>2020-02-27T22:45:21.444000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com6c2c41c95b37896c3e1b01558b0317e8627e0294</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;Open the object.  Change the word PROGRAM to FUNCTION_BLOCK above where your variables are defined.  Close the object.  It should switch to an FB.  I use v3.x now and this is how it is done in 3.x, but if I remember correctly, it was the same on v2.3.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Converting a program into a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/c7158787c5/?limit=25#7ddf" rel="alternate"/><published>2020-02-27T22:45:19.785000Z</published><updated>2020-02-27T22:45:19.785000Z</updated><author><name>tonypdean</name><uri>https://forge.codesys.com/u/tonypdean/</uri></author><id>https://forge.codesys.com01e85cc6c7336692806086f1e7e8efaaafc1e957</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a program written as a SFC but I now need to implement several instances of the program so I thought it best to have the code as a function block. Is there a way to convert the program into a function block or would I need to start again?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Tony&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>