LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using library files generated by application builder

Hello. I had this issue when I generated .h/.lib/.dll from .vi using application builder (Labview 7.1 PDS) and later tried to call the .h from C.

For instance, I have two .vi's: loadconfig.vi (read from a specific config text file), setdevice.vi (set the hard ware based on the given config parameters).

 

First I made loadconfig.vi into a library, and called the function "loadconfig" from C. It worked fine, returning the correct parameters from the file.

 

Next I combined loadconfig.vi together with setdevice.vi into one library, and again called the function "loadconfig" from C (did not call "setdevice"). This time it did not work. Debug showed that the config file was not even read.

 

We were pretty sure all the .lib/.dll were updated and included correctly in the two trials. There was no change on the two vi's throughout the time. This problem doesn't happen all the time, i.e., "loadconfig" functions properly when combined in a single library with some .vi's, but not all.

 

Does anyone has any idea what could be messed up like this when we put multiple vi's into one library ?

Thank you. 

0 Kudos
Message 1 of 9
(2,774 Views)

Hi Xiaolan,

 

Are you ensuring you are including both VIs in your library? You can force it to do so in the setup under Always Included.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 2 of 9
(2,743 Views)

Jeff, thanks for the suggestions. I am not so sure I found the setup you mentioned (7.1 might have a different panel). Is that the setup of the application builder or Labview ?

 

Anyway what I did was to add all the vi's as exported vi's to the library. I guess they were both added as in the .h file both function definitions are visible. 

 

What bugs us most is that when you have one function in the library it works well; when you have two functions in the library even the first one stops working. 

 

Thanks.

0 Kudos
Message 3 of 9
(2,735 Views)

Xiaolan,

When you say that it does not work, what exactly do you mean?  Does it give you an error, or just return zero always, or return incorrect values?  Also, you mentioned that the problem occurs when certain VIs are added, but not others.  Have you been able to determine any similarities between the VIs that cause problems (such as a type of functions that they use)?  Here is another discussion forum that talks about a similar issue related specifically to analysis functions. 

http://forums.ni.com/ni/board/message?board.id=170&message.id=249206&requireLogin=False

I hope this helps,

 

-Christina

0 Kudos
Message 4 of 9
(2,711 Views)

Christina, "doesn't work" means returning zero/some nonsense values in my case, as if the function doesn't do anything. Thanks a lot for bringingup the other helpful post ! I will try that path.

 

 

 

Xiaolan

0 Kudos
Message 5 of 9
(2,694 Views)
Let us know how it goes, Xiolan.
Jeff | LabVIEW Software Engineer
0 Kudos
Message 6 of 9
(2,678 Views)

Hi. I tried to regenerate the dll under LV 8.6 with the same error. So it doesn't look like a version problem.

 

What happened is that, whenever the dll includes vi's that require lvdaq.dll, all the included vi's won't work properly, i.e., when you call them in dll/header, they won't do anything.

 

For example, I put A.vi and B.vi in a library, where B.vi needs lvdaq.dll to run. Then when I call the built library from C, even function A won't do anything (as if nothing has been called).  

The problem doesn't occur when none of the vi's require lvdaq.dll.

 

I tried the mentioned approach in the thread Christina brought out (including lvdaq.dll when building the dll). Not work here. Anyway we assume LV is supposed to do the job of including all necessary library when building the application.

 

Thanks. We are really baffled.

0 Kudos
Message 7 of 9
(2,614 Views)

It is not enough to just include lvdaq.dll. You HAVE to install the complete driver. With any version of LabVIEW after 7.1, you can easily include the driver when you create the installer. For older versions, it's probably easier to just manually install.

 

LabVIEW and other programming languages do not (and probably never will), include in the exe the necessary hardware drivers.

Message 8 of 9
(2,610 Views)
Yes, I would agree with Dennis, install the whole driver on the other PC.
Jeff | LabVIEW Software Engineer
0 Kudos
Message 9 of 9
(2,566 Views)