<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to FB_INIT in library</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9aa686b88c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9aa686b88c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/9aa686b88c/</id><updated>2024-05-23T15:58:32.656000Z</updated><subtitle>Recent posts to FB_INIT in library</subtitle><entry><title>FB_INIT in library</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9aa686b88c/?limit=25#4b25" rel="alternate"/><published>2024-05-23T15:58:32.656000Z</published><updated>2024-05-23T15:58:32.656000Z</updated><author><name>alexgooi</name><uri>https://forge.codesys.com/u/alexgooi/</uri></author><id>https://forge.codesys.comb8d0fa2e84b92c843a7376018b037fef9826c670</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Paro, I have tried this and it seemed to have solved the problem, thank you very much!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>FB_INIT in library</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9aa686b88c/?limit=25#aabc" rel="alternate"/><published>2024-05-23T10:04:45.649000Z</published><updated>2024-05-23T10:04:45.649000Z</updated><author><name>paro</name><uri>https://forge.codesys.com/u/paro/</uri></author><id>https://forge.codesys.comd25d6c32ceba5cbdd5434b6028ed9a9d1dc844b5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I think the attribute here will help you: &lt;a href="https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_global_init_slot.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_pragma_attribute_global_init_slot.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_global_init_slots.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_global_init_slots.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>FB_INIT in library</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9aa686b88c/?limit=25#770d" rel="alternate"/><published>2024-05-22T09:59:49.044000Z</published><updated>2024-05-22T09:59:49.044000Z</updated><author><name>alexgooi</name><uri>https://forge.codesys.com/u/alexgooi/</uri></author><id>https://forge.codesys.combeb572ab65f41d5a3f245a0e6acf0663523f77d4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear Forum,&lt;/p&gt;
&lt;p&gt;I currently have a challenge. I have a library with some communication classes. These communication classes need to be linked to an interface like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Devices_and_controllers.Comm_Frame.Modbus_GVL_Link.KNX_TCP[Interface_Index] := THIS^;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is executed via a FB_Init() method. When I try to do this in a program this works fine. But when I declare the FB_Init() in the library the FB_Init() method is being called but the link is not made (interface still has the value 0000000000). The Objects and interfaces are defined in the library (GVL), so I’m assuming the data should be there.&lt;br/&gt;
When I call the FB_Init method explicitly in the program it also works fine. &lt;br/&gt;
Whys is this not working when it is all defined in the library? And is it even possible to create a structure like this in Codesys? &lt;br/&gt;
Kind regards&lt;br/&gt;
Alex&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>