<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Library and external variables</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/</id><updated>2020-02-27T13:51:15.051000Z</updated><subtitle>Recent posts to Library and external variables</subtitle><entry><title>Library and external variables</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/?limit=25#4bc6" rel="alternate"/><published>2020-02-27T13:51:15.051000Z</published><updated>2020-02-27T13:51:15.051000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com9dc772abc4677da298c27d53ac501d760df41eeb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;That said, as long as you declare your variables in a global variable list (in your Library), you should be able to access it from your program (if they are public).&lt;/p&gt;
&lt;p&gt;May be you are looking for VAR_EXTERNAL declaration : &lt;a class="" href="https://help.codesys.com/webapp/_cds_vartypes_var_external;product=codesys;version=3.5.14.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_vartypes_var_external;product=codesys;version=3.5.14.0&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Library and external variables</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/?limit=25#b3d9" rel="alternate"/><published>2020-02-27T13:51:14.603000Z</published><updated>2020-02-27T13:51:14.603000Z</updated><author><name>GUI</name><uri>https://forge.codesys.com/u/gui/</uri></author><id>https://forge.codesys.com5459578fab2c0ec9b8e5443376c925a23634103d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;yes, for sure ... I can do it with a pointer but have to initialize it !&lt;br/&gt;
I also already use variable from other library ....&lt;/p&gt;
&lt;p&gt;is it possible to do without a pointer ?&lt;/p&gt;
&lt;p&gt;I tried to use in the library&lt;br/&gt;
VAR_EXTERN&lt;br/&gt;
 a: INT&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;and "a" is defined on the application&lt;br/&gt;
It seemed something similar to "C" ... (extern int a) but it has not same intent ... it generate an error anyway.&lt;/p&gt;
&lt;p&gt;it would be good to have a sort of library that is just &lt;span style="color: underline;"&gt;CODE ATTACHED&lt;/span&gt; to the main application, so with possibility to call any variable or function too.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Library and external variables</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/?limit=25#e140" rel="alternate"/><published>2020-02-27T13:51:14.470000Z</published><updated>2020-02-27T13:51:14.470000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com3300c44807b3669be6920eabfbb59423b2890292</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You can link a variable from another Library.&lt;/p&gt;
&lt;p&gt;You can also define a pointer that should be initialized to point on that value.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Library and external variables</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2cd11db57b/?limit=25#2869" rel="alternate"/><published>2020-02-27T13:51:14.344000Z</published><updated>2020-02-27T13:51:14.344000Z</updated><author><name>GUI</name><uri>https://forge.codesys.com/u/gui/</uri></author><id>https://forge.codesys.combd7222a6873e415a338865613a72714bdd18ecdb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;br/&gt;
is it possible from a library to access an external variale (declared on the application, not on the library itself) ?&lt;/p&gt;
&lt;p&gt;on "C" programming it is used the "extern" keywork, to define a variable that is external to a library (and so linked later, when library and main application are put together)&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>