<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/</id><updated>2020-02-27T13:54:30.324000Z</updated><subtitle>Recent posts to Methods Auto-Instantiation for a Library Function Block</subtitle><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#5bbb" rel="alternate"/><published>2020-02-27T13:54:30.324000Z</published><updated>2020-02-27T13:54:30.324000Z</updated><author><name>Halim</name><uri>https://forge.codesys.com/u/halim/</uri></author><id>https://forge.codesys.comb2cd244b2679e81dd7bfffc90d0d167a3d952d55</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks a lot for your answers.&lt;/p&gt;
&lt;p&gt;I figured out that to keep the same structure and implement the base implementations each time a call happens, I have to use Interfaces (ITF). It works for me now, Thanks!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#1940" rel="alternate"/><published>2020-02-27T13:54:30.077000Z</published><updated>2020-02-27T13:54:30.077000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.come2b213b3f8866e66a9fb9583826342ae16687135</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Looks like some wrong access specifier :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Codesys Help hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Access specifier&lt;br/&gt;
Controls access to data.&lt;br/&gt;
PUBLIC or not specified: Access is not restricted.&lt;br/&gt;
PRIVATE: Access is restricted to the program, function block, or GVL.&lt;br/&gt;
The object is marked as (private) in the POU or device view. The declaration contains the keyword PRIVATE.&lt;br/&gt;
PROTECTED: Access is restricted to the program, function block, or GVL with its derivations. The declaration contains the keyword PROTECTED.&lt;br/&gt;
The object is marked as (protected) in the POU or device view.&lt;br/&gt;
INTERNAL: Access to the method is restricted to the namespace (library).&lt;br/&gt;
The object is marked as (internal) in the POU or device view. The declaration contains the keyword INTERNAL.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class="" href="https://help.codesys.com/webapp/_cds_obj_method;product=codesys;version=3.5.14.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_obj_method;product=codesys;version=3.5.14.0&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#9bd9" rel="alternate"/><published>2020-02-27T13:54:29.894000Z</published><updated>2020-02-27T13:54:29.894000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com31202dcac2248321ef3a30ef4ed81fe70778e54a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Instantiation of an FB is not the process of call him, is rhe process of the creation (the declaration between var end_var.&lt;/p&gt;
&lt;p&gt;In the body of the pou, you are calling an special method of the fb -the body of the fb-.&lt;/p&gt;
&lt;p&gt;The methods are not called automatically. You can call him from inside the own fb or from fb-init (only one time as comminback says).&lt;/p&gt;
&lt;p&gt;When you instantiate an fb, his methods is not necessary to recreate or instantiate. Are there if you need to use it.&lt;/p&gt;
&lt;p&gt;One FB is an structure of variables (variables that you have created inside the fb) and methods associates with it ( including the fb body).&lt;/p&gt;
&lt;p&gt;When you create an instance of an Fb, you have created one copy of the structure. The methods are the same for all FBs.&lt;/p&gt;
&lt;p&gt;When you call an method of an FB, this method works with the structure of the Fb.&lt;/p&gt;
&lt;p&gt;I don't know if it is the answer that you need...&lt;/p&gt;
&lt;p&gt;Salut!&lt;/p&gt;
&lt;p&gt;Sent from my Moto G (5S) Plus using Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#afe3" rel="alternate"/><published>2020-02-27T13:54:29.713000Z</published><updated>2020-02-27T13:54:29.713000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.com4871abeef107ebcd77cb7099bcbf1bb1e4a1615f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I think you are asking about this: &lt;a class="" href="https://help.codesys.com/webapp/_cds_method_fb_init_fb_reinit;product=codesys;version=3.5.14.0#interface-of-the-fb-init-method" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_method_fb_init_fb_reinit;product=codesys;version=3.5.14.0#interface-of-the-fb-init-method&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the FB_Init method will call anything you ask it to when the function block is created.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#1cf6" rel="alternate"/><published>2020-02-27T13:54:29.131000Z</published><updated>2020-02-27T13:54:29.131000Z</updated><author><name>Halim</name><uri>https://forge.codesys.com/u/halim/</uri></author><id>https://forge.codesys.com12fae773973538a31bb1a349432a3eb4d732f9da</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I mean: Suppose I have a Function Block that has two attached Methods 1 &amp;amp; 2. When I instantiate the FB, I need the methods POUs to be instantiated as well under the new Function Block Instance. I attached a photo with the desired behavior for illustration.&lt;br/&gt;
In red: the current behavior, I have to create the new methods POUs manually, and select the methods from a list.&lt;br/&gt;
In green: I want all the methods in the template created in my project once I instantiate the FB&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: desired.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4403"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#35e8" rel="alternate"/><published>2020-02-27T13:54:28.952000Z</published><updated>2020-02-27T13:54:28.952000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.comd38fbb1a55248d31e290c7f480b324d658a3a140</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What do you mean with "instantiate methods"&lt;/p&gt;
&lt;p&gt;Sent from my Moto G (5S) Plus using Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Methods Auto-Instantiation for a Library Function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/65d6e05e0b/?limit=25#26cf" rel="alternate"/><published>2020-02-27T13:54:28.771000Z</published><updated>2020-02-27T13:54:28.771000Z</updated><author><name>Halim</name><uri>https://forge.codesys.com/u/halim/</uri></author><id>https://forge.codesys.comb1a58aa3f25fffeea74882bed582cecb3e6d65dc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm creating a library function block with some Methods under/attached to that FB. I want the Methods to get instantiated automatically once the parent FB instance is created.&lt;br/&gt;
Can someone guide me on how to do that?&lt;/p&gt;
&lt;p&gt;Thanks in advance for your time.&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>