<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Passing EtheNetIP adapter device into a Function Block to access it's IO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/06b876cefb/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/06b876cefb/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/06b876cefb/</id><updated>2025-10-28T18:31:34.102000Z</updated><subtitle>Recent posts to Passing EtheNetIP adapter device into a Function Block to access it's IO</subtitle><entry><title>Passing EtheNetIP adapter device into a Function Block to access it's IO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/06b876cefb/?limit=25#7a06" rel="alternate"/><published>2025-10-28T18:31:34.102000Z</published><updated>2025-10-28T18:31:34.102000Z</updated><author><name>wchin</name><uri>https://forge.codesys.com/u/wchin/</uri></author><id>https://forge.codesys.com7da89051cbd499200e6852528df5430e8ec31554</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;We are creating helper function blocks for our VFD(EtherNetIP).  How should I set it up so that I can pass the device into and out of the Function Block so that ideally I can access the IO of the device by devicename.channelname.&lt;br/&gt;
So something like for example we have a VFD with a start bit that is in the ControlWord channel and a SetVelocity that is a channel. And we want to create a Function Block called StartVFD.  So I declare something like:&lt;br/&gt;
FUNCTION_BLOCK StartVFD&lt;br/&gt;
VAR_IN_OUT &lt;br/&gt;
    device: ioDrvEthernetIP.RemoteAdapter;&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR_INPUT&lt;br/&gt;
    velocity : REAL;&lt;/p&gt;
&lt;p&gt;So in the code it would look something like&lt;br/&gt;
    device.SetVelocity := velocity;&lt;br/&gt;
    device.ControlWord.6 := True;&lt;/p&gt;
&lt;p&gt;We have a pretty basic eds file for our VFD and can update it if necessary.&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>