<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Help with  __SYSTEM.VAR_INFO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/</id><updated>2025-01-26T21:04:22.292000Z</updated><subtitle>Recent posts to Help with  __SYSTEM.VAR_INFO</subtitle><entry><title>Help with  __SYSTEM.VAR_INFO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/?limit=25#cb7b" rel="alternate"/><published>2025-01-26T21:04:22.292000Z</published><updated>2025-01-26T21:04:22.292000Z</updated><author><name>ph0010421</name><uri>https://forge.codesys.com/u/ph0010421/</uri></author><id>https://forge.codesys.com1f87ea31af6f963e5e26ff53201361eec12e0028</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;thanks...I changed to I POINTER which is perfect.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Help with  __SYSTEM.VAR_INFO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/?limit=25#77ab" rel="alternate"/><published>2025-01-26T15:16:45.014000Z</published><updated>2025-01-26T15:16:45.014000Z</updated><author><name>Fless</name><uri>https://forge.codesys.com/u/fless/</uri></author><id>https://forge.codesys.comb1b7803825de89ee3f3922eb6bca9c97c8bef316</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;to get the address just use ADR( )&lt;/p&gt;
&lt;p&gt;variables defined in a VAR_IN_OUT block are references pointing to the passed variables.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;VAR_IN_OUT&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;MyVar&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;bool&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;adrMyVar&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;__XWORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;

&lt;span class="nt"&gt;adrMyVar&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;MyVar&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</summary></entry><entry><title>Help with  __SYSTEM.VAR_INFO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/?limit=25#4501" rel="alternate"/><published>2025-01-26T13:37:37.440000Z</published><updated>2025-01-26T13:37:37.440000Z</updated><author><name>trusty-squire</name><uri>https://forge.codesys.com/u/trusty-squire/</uri></author><id>https://forge.codesys.com0c4e3660e77ce2528871a53acdb79213b6d23a2e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Not knowing exactly what you want to accomplish, you can try to use&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;VAR_INPUT&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;MyVar&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;POINTER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;BOOL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;MyVar&lt;/code&gt; contains the address of your referenced variable, and &lt;code&gt;MyVar^&lt;/code&gt; dereferences it allowing you to access the value. If this doesn't meet your needs, could you add more detail on what you are trying to accomplish?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Help with  __SYSTEM.VAR_INFO</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f66ccf1567/?limit=25#a8cd" rel="alternate"/><published>2025-01-24T12:46:09.516000Z</published><updated>2025-01-24T12:46:09.516000Z</updated><author><name>ph0010421</name><uri>https://forge.codesys.com/u/ph0010421/</uri></author><id>https://forge.codesys.comd25f4c6d81afdc944474a582f7752eb3eb94df56</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hi all&lt;br/&gt;
I have a FB with IN/OUT variable.&lt;br/&gt;
Inside the FB, I want to get the address of the IN/OUT variable.&lt;br/&gt;
If I use &lt;strong&gt;__SYSTEM.VAR_INFO&lt;/strong&gt;, I get the address of the FB copy rather than 'external' variable.&lt;/p&gt;
&lt;p&gt;VAR_IN_OUT&lt;br/&gt;
    MyVar: bool;&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR&lt;br/&gt;
    Info: __SYSTEM.VAR_INFO;&lt;/p&gt;
&lt;p&gt;Info := __VARINFO(MyVar);&lt;/p&gt;
&lt;p&gt;This give me the address of &lt;strong&gt;MyVar&lt;/strong&gt; but I actually want the address of the variable passed to MyVar&lt;/p&gt;
&lt;p&gt;Any clues please??&lt;/p&gt;
&lt;p&gt;thanks, ph&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>