09-18-2013 02:57 PM
Hi guys,
So I've been working on porting a VI developed on 2009 Labview on Windows over to 8.2 on Linux. Initially I was having some problems because the program seem to have broken after the port but we realized it was some compatiblity with the TCP communcation functions. We solved it by writing some new TCP open/send/recieve/close functions in C and called the functions through a sub VI calling a library function node.
Now, the program runs completely fine on labview on the development machine where I have all the files. However, things seem to break down when I build the program as an executable to be run on a machine without labview.
From what I can tell, it seems as though the library function node is unable to find the proper .so file to reference. However, I've tried numerous methods of passing the correct path of the .so file to the library function no but nothing seems to work. I've tried implementing path on the sub-vi level then up to the vi level but the results are all the same, the program works in labview fine but the TCP communcations break when i compile.
So can anyone tell me or point me to a good tutorial on how to properly implement and build with library function nodes and also properly referecing the required .so files?
Thanks guys,
Jason.
09-19-2013 03:47 PM - edited 09-19-2013 03:47 PM
Hi Jason,
If you open example finder in LabVIEW (Help>>Find Examples…) and search DLL, you may find the “External Code (DLL) Execution.vi” to be helpful.
There is some thorough documentation on how to use external code in LabVIEW at the following link:
http://www.ni.com/pdf/manuals/370109a.pdf
I would double check to make sure you are compiling the C code to the correct format. To run it on a Linux machine the .so file must be in the ELF file format, not the PE format (which is what DLL files use).
I am also wondering why you need to re-write the TCP functions, there should be a Linux LabVIEW equivalent function for each of the LabVIEW Windows functions.
Regards,
Shane C
09-19-2013 05:34 PM
Hi Shane,
Thanks for the reply though I just worked it out today. It turns out when my supvisor created the vi calling the TCP functions he checked off "specify path on diagram", thus requiring me to pass the function call the location of the library for every instance. Everything worked once I unchecked the box and referenced the library through the call library function UI.
I'm actually unsure why my supevisor decided to implement his own TCP functions. We've tried replacing all the functions with the ones included in the linux version of Labview 8.2 but it didn't work. One day he approached me and told me he read some article and made the decision to use C code.
Anyway, thanks again for the help Shane!
Jason.