From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW.LIB was not called from a LabVIEW process

Hi All,

 

I've inherited LV code that calls a CIN node to access a motor controller.  I'd like to compile this code to a .NET DLL, but receive the following error when calling it from an external source:

 

LV.LIB Error

 

I've read the knowledgebase article explaining the problem from here, as well as the following support questions:

http://forums.ni.com/t5/LabVIEW/Labview-lib-was-not-called-from-a-labview-process/m-p/232548

http://forums.ni.com/t5/LabVIEW/Problem-with-lsb-LABVIEW-LIB-was-not-called-from-a-LabVIEW/m-p/48809...

http://forums.ni.com/t5/LabVIEW/Labview-lib-was-not-calld-from-a-labview-process/m-p/718427

http://forums.ni.com/t5/LabVIEW/Building-a-LabVIEW-DLL-with-VIs-that-use-CINs/m-p/632817

 

The conclusion seems to be recompiling is the answer.  I've tried recompiling the original CIN vi within LV with no success.  Do they mean to recompile the original C code against the newer labview.lib (sorry, I'm not all that familiar with how the CIN nodes work)?  Any suggestions would be awesome.  Thanks.

 

-Joe

 

0 Kudos
Message 1 of 3
(2,981 Views)

You can't make use of LabVIEW manager functions in non-LabVIEW based processes. Basically unless the C code is for a CIN or DLL that is to be called by LabVIEW (inside the development system or a LabVIEW built application), any function pulled in from labview.lib is not available. LabVIEW.lib is an import library that does not implement any functions but simply imports them from the LabVIEW kernel, either the LabVIEW development system or the LabVIEW runtime DLL. And no you can't just link in the LabVIEW runtime DLL into your .Net application. This DLL needs to be started up and initialized in very specific ways, that only LabVIEW itself knows about when building an application.

 

Basically if you want to recompile the code (yes in C/C++) for use in a non-LabVIEW application, you also have to remove all the link libraries from the LAbVIEW cintools directory, and replace any use of functions now unavailable (link error: unavailable external reference) with other similar functionality from your C runtime library. Or implement those functions yourself using C runtime library calls.

 

Another possibility could be to actually create a LabVIEW executable that exports the functionality as ActiveX Server. Or in LabVIEW 2010 you could also select to create a .Net Interop Assembly from inside the LabVIEW project.

Rolf Kalbermatter
My Blog
Message 2 of 3
(2,975 Views)

Thanks for the help.  I was able to find a DLL from the same 3rd-party company that has the same functions as the CIN.  So it's resolved for me.

0 Kudos
Message 3 of 3
(2,959 Views)