<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Ethernet/IP Symbolic Access to I/O Channels pass the EIP Device FB instance to another FB IN_OUT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec93980d92/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec93980d92/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ec93980d92/</id><updated>2023-08-01T09:12:27.010000Z</updated><subtitle>Recent posts to Ethernet/IP Symbolic Access to I/O Channels pass the EIP Device FB instance to another FB IN_OUT</subtitle><entry><title>Ethernet/IP Symbolic Access to I/O Channels pass the EIP Device FB instance to another FB IN_OUT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec93980d92/?limit=25#4f0a" rel="alternate"/><published>2023-08-01T09:12:27.010000Z</published><updated>2023-08-01T09:12:27.010000Z</updated><author><name>matthew</name><uri>https://forge.codesys.com/u/matthew/</uri></author><id>https://forge.codesys.com43be704d8702efd6d7cf61ed8811ce8630b39272</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I take it this is not possible in CodeSys currently since everything has to be declared as static, I have been researching and reading into OOP and some of the limitations with CodeSys, I see there is the _NEW for dynamic memory, but does not look like a robust solution. Am I best just going back to the traditional method of mapping data?  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Ethernet/IP Symbolic Access to I/O Channels pass the EIP Device FB instance to another FB IN_OUT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec93980d92/?limit=25#ff2b" rel="alternate"/><published>2023-07-30T10:16:16.545000Z</published><updated>2023-07-30T10:16:16.545000Z</updated><author><name>matthew</name><uri>https://forge.codesys.com/u/matthew/</uri></author><id>https://forge.codesys.coma12c35c1f27b93c43ec1596adb7bce04431563a6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi there, &lt;/p&gt;
&lt;p&gt;I'm having trouble working out how to pass the EIP devices FB instances into my function block since each EIP device has a different name and IEC Object type.&lt;/p&gt;
&lt;p&gt;I have just tested this and can access all the parameters of the device for example.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;_3G3AX_MX2_EIP_A4055_v1_4_FB.RunFwd &lt;/span&gt;
&lt;span class="err"&gt;_3G3AX_MX2_EIP_A4055_v1_4_FB.RunRev&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now I can create an instance:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;Drive&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;_3G3AX_MX2_EIP_A4055_v1_4_FB&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I can now use that drive instance:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;Drive.RunFwd&lt;/span&gt;
&lt;span class="err"&gt;Drive.RunRev&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The Problem I have is codesys creates an FB per device with different name/instance...&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; _3G3AX_MX2_EIP_A4055_v1_4_1_FB&lt;/span&gt;
&lt;span class="err"&gt; _3G3AX_MX2_EIP_A4055_v1_4_2_FB&lt;/span&gt;
&lt;span class="err"&gt; _3G3AX_MX2_EIP_A4055_v1_4_3_FB&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I need a way to pass that whole instance into my function block, maybe using in-out variable, reference/pointer or something. But I can't do this easily because I need to declare the instance inside the function block and each instance has a different name.&lt;/p&gt;
&lt;p&gt;Is there a way to use the input/output of the function block to pass the instance?&lt;/p&gt;
&lt;p&gt;If I can just pass _3G3AX_MX2_EIP_A4055_v1_4_FB into my function block without having to declare it inside of my function block. I can then use my one VSD FB and just assign each EIP device to my function block and won't have to map hundreds of variables and It's easy to add and change stuff etc in the future&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>