<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Communication between Libraries with pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/</id><updated>2020-02-27T14:12:01.123000Z</updated><subtitle>Recent posts to Communication between Libraries with pointer</subtitle><entry><title>Communication between Libraries with pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/?limit=25#c31e" rel="alternate"/><published>2020-02-27T14:12:01.123000Z</published><updated>2020-02-27T14:12:01.123000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comc7a1cbfcc4582b47dce068b617c96a9fb9542098</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;Instead of trying to pass a pointer, try having your library 2 require library 1. Then from within library 2, you can call any PRGs or FBs in library1.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Communication between Libraries with pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/?limit=25#0bc9" rel="alternate"/><published>2020-02-27T14:12:00.783000Z</published><updated>2020-02-27T14:12:00.783000Z</updated><author><name>rickj</name><uri>https://forge.codesys.com/u/rickj/</uri></author><id>https://forge.codesys.com07970cd76f72b2ced5bd41047b9a9188045a3794</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The error list you show looks, to me, like a compiler crash.  Also isn't "GVL" a reserved word?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Communication between Libraries with pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/?limit=25#3687" rel="alternate"/><published>2020-02-27T14:12:00.387000Z</published><updated>2020-02-27T14:12:00.387000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com89508417a2d6e232fc0494a79fa8c95676550771</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; KevinR&lt;/p&gt;
&lt;p&gt;Welcome to the community,&lt;/p&gt;
&lt;p&gt;sorry - but your question is hard to understand. Maybe it helps, if you can post all of your code or upload an example project. &lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br/&gt;
Kevin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Communication between Libraries with pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/?limit=25#aa30" rel="alternate"/><published>2020-02-27T14:11:59.301000Z</published><updated>2020-02-27T14:11:59.301000Z</updated><author><name>Ron123</name><uri>https://forge.codesys.com/u/ron123/</uri></author><id>https://forge.codesys.comcc2196b766918861aa3f7a67c1d22eb9d52fe0b2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Maybe I have to explain my problem a little bit more... &lt;br/&gt;
This is how my program looks like:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Library1:&lt;/strong&gt;&lt;br/&gt;
Logging.prg&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Library2:&lt;/strong&gt;&lt;br/&gt;
GVL holds the pointer:&lt;br/&gt;
pLog : pointer to Library1.Logging();&lt;/p&gt;
&lt;p&gt;Program.prg with M_DoSomething().&lt;br/&gt;
Inside the method the foloowing code exists:&lt;br/&gt;
pLog^.Fatal('Caller','LogMsg');&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Main.prg:&lt;/strong&gt;&lt;br/&gt;
1. Set the pointer to Library2: "Library2.Initialize(pLog := ADR(Library1.Logging());"&lt;br/&gt;
2. Execute "Library2.Program();"&lt;br/&gt;
3. call: "Library2.M_DoSomething();)&lt;/p&gt;
&lt;p&gt;The error comes while building the solution as soon as I implement the execution "Library2.Program();" or call "Library2.M_DoSomething();).&lt;br/&gt;
If i do not implment this into main, there is no compiling error.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Communication between Libraries with pointer</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b7bbfab06c/?limit=25#b63c" rel="alternate"/><published>2020-02-27T14:11:58.944000Z</published><updated>2020-02-27T14:11:58.944000Z</updated><author><name>Ron123</name><uri>https://forge.codesys.com/u/ron123/</uri></author><id>https://forge.codesys.comf7a3574761ace25f31e66a2d36baa144d966838b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi&lt;br/&gt;
I am trying to establisch a communication between 2 of my libs using TwinCat 3 Built 4020.10. &lt;br/&gt;
For that I tried to pass a pointer to a program of lib1 to lib 2 and save it there.&lt;/p&gt;
&lt;p&gt;But during built of the program which is using both libs I get the following error #3580:&lt;br/&gt;
"Internal error in _IStatement (maybe try to simplify expressions): GVL.pLog^.Fatal(Caller:=sFuncName,Msg:=strLogMsg): &lt;br/&gt;
System.NullReferenceException: ..."&lt;/p&gt;
&lt;p&gt;By the way the above line of code is inside lib 2 and "pLog" is the pointer i passed to lib2...&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;br/&gt;
Thanks!&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: built error3580.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2083"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>