<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to External library in C</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/84f6f0778d/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/84f6f0778d/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/84f6f0778d/</id><updated>2020-02-27T21:06:55.618000Z</updated><subtitle>Recent posts to External library in C</subtitle><entry><title>External library in C</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/84f6f0778d/?limit=25#540c" rel="alternate"/><published>2020-02-27T21:06:55.618000Z</published><updated>2020-02-27T21:06:55.618000Z</updated><author><name>ljean</name><uri>https://forge.codesys.com/u/ljean/</uri></author><id>https://forge.codesys.comdcb6ecee96487b60c6f65ec4cf127abb930c9c31</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You don't really need this file and you can use your own C macros. But be careful because there are some differences in the IEC types and the C types (eg INT is 2 bytes in CoDeSys and 4 bytes in C)&lt;/p&gt;
&lt;p&gt;I would recommend to modify the headers generated bu CoDeSys in order to prefix all types with something like "SP_". Then you must define your macros. I think the following macros are valid for PlcWinNT and Visual C++...&lt;/p&gt;
&lt;p&gt;#define SP_BOOL char&lt;/p&gt;
&lt;p&gt;#define SP_BYTE unsigned char&lt;/p&gt;
&lt;p&gt;#define SP_INT short&lt;/p&gt;
&lt;p&gt;#define SP_UINT unsigned short&lt;/p&gt;
&lt;p&gt;#define SP_WORD unsigned short&lt;/p&gt;
&lt;p&gt;#define SP_DINT long&lt;/p&gt;
&lt;p&gt;#define SP_UDINT unsigned long&lt;/p&gt;
&lt;p&gt;#define SP_DWORD unsigned long&lt;/p&gt;
&lt;p&gt;#define SP_REAL float&lt;/p&gt;
&lt;p&gt;#define SP_LREAL double&lt;/p&gt;
&lt;p&gt;#define SP_TRUE  1&lt;/p&gt;
&lt;p&gt;#define SP_FALSE 0&lt;/p&gt;
&lt;p&gt;I think that these macros depends from your compiler and your Runtime System: Be careful...  &lt;/p&gt;
&lt;p&gt;I hope it helps&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>External library in C</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/84f6f0778d/?limit=25#702c" rel="alternate"/><published>2020-02-27T21:06:51.559000Z</published><updated>2020-02-27T21:06:51.559000Z</updated><author><name>romk</name><uri>https://forge.codesys.com/u/romk/</uri></author><id>https://forge.codesys.com3bbe107506f99cd99f549954aa883082a1c2e5ba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In document C_IN_32Bit_E.pdf which is describes this operation more &lt;/p&gt;
&lt;p&gt;I found: "Type definitions, such as BOOL, which are used in the header&lt;/p&gt;
&lt;p&gt;file are found in the file lzstyp.h." - but I don't have this file anywhere in my installed codesys v. 2.3.6.1, where can I fond this file, describes all codesys definitions in C/C++ format?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>External library in C</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/84f6f0778d/?limit=25#8a51" rel="alternate"/><published>2020-02-27T21:06:50.113000Z</published><updated>2020-02-27T21:06:50.113000Z</updated><author><name>RolandWagner</name><uri>https://forge.codesys.com/u/rowa/</uri></author><id>https://forge.codesys.comac8c3c2146f49db4c6e78be2cc012e47241b35bd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;there is a general way how to do so.&lt;/p&gt;
&lt;p&gt;Please find attached a first document about the preparation / implementation of external libaries in CoDeSys (C_in_CoDeSys_e.pdf).&lt;/p&gt;
&lt;p&gt;But the way how to implement external libaries depends on the runtime system and the compiler for it. Please find attached a document for 32 Bit runtime systems. But please contact in any case your project manager in order to confirm the right way how to do so.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=88" rel="nofollow"&gt;C_in_CoDeSys_e.pdf &lt;span&gt;&lt;span&gt;[91.04 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=87" rel="nofollow"&gt;C_IN_32Bit_E.pdf &lt;span&gt;&lt;span&gt;[179.98 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>External library in C</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/84f6f0778d/?limit=25#1090" rel="alternate"/><published>2020-02-27T21:06:46.103000Z</published><updated>2020-02-27T21:06:46.103000Z</updated><author><name>ljean</name><uri>https://forge.codesys.com/u/ljean/</uri></author><id>https://forge.codesys.com5a126e298bd413d26b35179d490d179e0d15b426</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I remember that I read in the past one document explaining how to write CoDeSys external libraries in C. I think there is the possibilty to load obj file dynamically with the Rts. Do you have a document explaining how to do it?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>