My device is a TCP/IP server and I already have the client interface coded in C. I want to connect Codesys systems (e.g. Codesys PLC) as a client and connect with my device over specific port and carry our read write operations.
One option is to use the NetbaseServices library and connect to the server. But in this case I have to rewrite the entire interface again in IEC (in Codesys).
I want to reuse the implementation already available. (We've already rewritten this interface from C# code.)
After searching this forum, I found at least 10-15 posts regarding the use of External library (ANSI C / C++). Also checked the documents "C_IN_32Bit_E.pdf" and "C_in_CoDeSys_e.pdf". but could not really comprehend how to work with this.
It seems from the documents that I have to first create the interface in Codesys and then write the C functions. But what if the C code is already available? Do I've to modify the .c or .h files? How will this be linked in the Codesys Project?
Is there any example code available for use of External C functions?