LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW.LIB was not called from a LabVIEW process when creating unit tests

We are developing a DLL to be integrated in LabVIEW using CLFs. So far we have the system working, but we wanted to create some unit tests in C as part of our release process. The problem is that when I link labview.lib in VS C++ and then call the EXE generated I get an error saying: "LABVIEW.LIB was not called from a LabVIEW process". As mentioned in http://zone.ni.com/reference/en-XX/help/371361J-01/lvexcodeconcepts/debug_dlls_and_dll_calls/:

"Calling the shared library from another C program is also another way to debug the shared library. By calling the shared library from another C program, you have a means of testing the shared library independent of LabVIEW, thus helping you to identify any problems, sooner."

 

Some of our functions, however, use LabVIEW specific instructions and we would like to test them in a realistic environment (i.e., calling to the actual functions instead of creating stubs).

 

Is there any workaround to this problem?

 

Thanks!!

 

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

Hello SaraGr,

 

Welcome to the NI Discussion Forums! I have a couple of questions to better determine the issue here:

 

1. What is the LabVIEW version that you are using?

 

2. Does your DLL uses Serial Compatibility VIs? If so, try using your development on NI-VISA instead of Serial.

 

3. Are you using a Code Interface Node (CIN)? If you do, I see that from the help file you would need to compile the code for the new platform. Also, please remember that functions specifc to CINs (such as SetCINArraySize) will not work in a DLL.

 

4. Be sure to include the header files in your program, like extcode.h. Please follow this white paper to link labview.lib to your program, or follow the Alternate Method.

 

Regards,
Daniel REDS
RF Systems Engineer

Help us grow.
If a post solves your question, mark it as The Solution.
If a post helps, give Kudos to it.
0 Kudos
Message 2 of 3
(2,085 Views)

Hello REDS,

 

Thanks for your answer.

  1. I'm using LabVIEW 2010.
  2. No, I'm not using Serial Compatibility VIs.
  3. No, I'm not using a CIN.
  4. labview.lib is linked correctly, the problem is when executing it outside LabVIEW.

I found a workaround. Instead of creating an executable, I've created a DLL and I'm calling it from a CLF. This is not ideal, but at least I can run the unit tests 🙂

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