LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Manager (labviewv.lib) support for Linux RT targets?

Solved!
Go to solution

Hello,

 

I have a cRIO which runs Linux RT (x64). I'd like to use a 3rd-party C++ library from an RT VI. The library has functions that aren't compatible with LabVIEW's Call Library Function Node (for example, functions that accepts a C++ string input). On Windows, I'd create my own wrapper library using LabVIEW Manager features to convert between LabVIEW types and C++ types.

 

Is it possible to do the same for Linux RT targets? Is there a version of labviewv.lib (either 32-bit or 64-bit) for Linux targets? (I only have a Windows development machine)

 

Thanks!

Certified LabVIEW Developer
0 Kudos
Message 1 of 7
(3,827 Views)

Hello,

 

It's not possible to create a personalized library with labview manager under RT Linux. Because you can import code on a RT Linux but not develop. However you can create your own library on Windows and export it on RT Linux target.

 

Best regards. 

0 Kudos
Message 2 of 7
(3,783 Views)

Hi elodie.k,


@elodie.k wrote:

you can create your own library on Windows and export it on RT Linux target.


Yes, this is what I want to do.

 

To be clear, I want to make a library using the C/C++ Development Tools for NI Linux Real-Time, just like this tutorial: http://www.ni.com/tutorial/14690/en/

 

 

However, I want my library to call LabVIEW Manager functions. So, I need a version of labviewv.lib that is compiled for Linux. When I have this file, I can link it to my own library. Where can I get this file?

 

 

Thanks!

Certified LabVIEW Developer
0 Kudos
Message 3 of 7
(3,767 Views)
Solution
Accepted by JKSH

Hello,

 

You needn't to intall labviewv.lib on your RT linux target. Just develop your application using Labview MAnager Functions on Windows and after deploy it on Rt Linux target.

 

Best regards.

Message 4 of 7
(3,755 Views)

@elodie.k wrote:

You needn't to intall labviewv.lib on your RT linux target. Just develop your application using Labview MAnager Functions on Windows and after deploy it on Rt Linux target.


Ah, I didn't realize that. I'll give it a try; thanks!

Certified LabVIEW Developer
0 Kudos
Message 5 of 7
(3,745 Views)

Elodie is correct.

 

Unlike the Windows DLL COFF format that requires an application to explicitedly import functions from other shared libraries, the ELF format used on Linux works differently. The shared library loader on Linux will by default search the entire export tables of all previously loaded ELF object code modules (ncluding the main executables export table if present) for missing symbols when a new module gets loaded. If it doesn't find it there it will search the cache created when running ldconfig. The import table in a shared library only contains a symbol name and an optional entry identifying the shared library file that should contain the symbol. The enire linking is performed at load time by the shared library loader.

A Windows DLL needs to contain specific code to link the entry point in the external module to the code inside its own module and that is what the link library labviewv.lib is doing, nothing more. For non-Windows systems this import link library is completely unneccessary.

 

One catch you should be aware off is that simply copying your shared library file to the realtime target is usually not enough. You have to place it in one of the directories that ldconf will search (all fully configurabele with configuration files as everything else in Linux) and then run ldconf to update the ld.so.conf cache that the shared library loader will use to find shared libraries.

Rolf Kalbermatter
My Blog
Message 6 of 7
(3,733 Views)

Very useful info. Thank you elodie.k for the answer, and rolk for the detailed explanation!

Certified LabVIEW Developer
0 Kudos
Message 7 of 7
(3,720 Views)