LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing vi.lib files in Run-Time LabVIEW 2012

Solved!
Go to solution

Hi

 

I've got a problem executing VI's under RT in LabVIEW 2012.

 

Our system consist of multiple independent modules which are opened and run from a Manager VI. VI paths to the modules are read from an .ini file by the Manager VI.

 

We have build a single executable (RT Launcher) that takes the path of the Manager VI as argument (Attachment : RT Launcher.png).

The RT Launcher is placed in the ..\National Instruments\LabVIEW 2012 folder as the LabVIEW.exe.

 

The RT Launcher is called from the CLI.

"C:\Program Files\National Instruments\LabVIEW 2012\RT Launcher.exe" "C:\Workspace\Labview\Manager.vi"

 

This will run the Manager.vi in the RunTime Environment and the Manager.vi will open the .ini file and execute the Module VI's one by one.

 

By calling the RT Launcher.exe from the same folder as the LabVIEW.exe, the search paths should be the same.

 

The system worked fine in LabVIEW 2010.

 

The Manager VI is opened with broken arrow and the errors indicate that vi.lib sub VIs are missing (attachment : Manager VI errors.png)

 

I know there are issues regarding object cache and separated compiled code from LV2010 -> LV2011 -> LV2012, but simply can't figure out how to come around this problem.

 

Can anyone explain the difference and how to solve the problem ?

 

Thanks

Regards Kahr
Certified LabVIEW Architect
CIM A/S
Download All
0 Kudos
Message 1 of 10
(7,918 Views)

Hi Kahr.

 

 

It sounds like you are making some dynamic calls to VI's, eg. by using 'Open VI Reference'. My answer is based on that assumption. 

 

You are absolutely right. In LabVIEW2010 we introduced a function called 'Separating Compiled Code from VI'. At that time none of the VIs from VI.lib had that option enabled. In LabVIEW2011, many VI's in VI.lib have, by default, a separation of compiled code and VI. This option cannot be changed (greyed out) for these VI's as well. This feature was introduced in order to simplify source code control.

Separating Compiled Code from VIs and Other File Types

 

The drawback is, that it is no longer possible to call VI's dynamically from an application (executable), when this option in enabled, since the compiled code no longer exists. The method of calling a VI dynamically from an application has been (and still is) used to make some kind of a plug-and-play architecture, meaning we have one EXE-file that only gets distributed once and a set of subVI's that gets redistributed according to new versions (new features added to the subVI), meaning we can make changes in the subVI without having to redistribute the EXE-file.

 

With the release of LabVIEW2011 and LabVIEW2012 we can no longer distribute VI's that uses functions from vi.lib, this also include DAQmx calls even though the DAQmx driver is installed.

 

The simple explaining is, that it has never been intended that VI's got distributed. Eg, when Microsoft is making a new software update for Windows7, they don't send out the source code to all the users.

 

The solution is therefore to wrap up the source code into 'something' that includes all the compiled files. In LabVIEW we do that in a couple of different ways.

1) Include the VI's in the EXE-file.

When building the application, we have the option to include files, that normally is not included in builds. If we call a SubVI dynamically this will not automatically be included! However, the drawback of this method is, that if you need to change  something in one of your SubVI's, you would need to build and distribute the entire application. Thereby, we are not making use of the plug-and-play architecture that we originally wanted. However, this method will fix the error.

Error 1003 When Using VI Server in a LabVIEW Application

 

2) Now, if we still want the plug-and-play architecture in LabVIEW2011+2012 (and this will properly be the same for the next many released of LabVIEW), this can still easily be achieved by making a Source Distribution. When we make a Source Distribution, we can include the VI's from VI.lib and thereby the compiled code. When using this method, two important things should be remembered:

a) Make the files into a LLB file. This will pack all the VI's into one single file, that is easy to distribute.

Go to Destinations ==> Destination Type ==> LLB.

b) Make sure not to 'Exclude files from vi.lib', as this method will then simply not work.

Go to Additional Exclusions ==> Remove checker mark in 'Exclude files from vi.lib'.

How Can I Call a VI Dynamically from an Executable Without Including Those VIs in the Build?

 

I have made a small example to demonstrate this:

Example: Using vi.lib

This example has two mainVIs and two EXE-applications. Build the two EXE-files, but do NOT build the source distribution yet.

1) Main(IncludeSubInExE). This version has included the subVI in the build distribution for the EXE-file. When running this EXE everything works fine, even when calling the subVI dynamically. However, since the subVI is build into the exe, we would have to redistribute the exe for every new version of the subVI. This breaks the hole idea.

2) Main. The subVI is no longer included in the build. When running and trying to call the subVI, you will get this error (on both your developer and run-time machine):

NotIncluded.png

Now, build the Source Distribution and run this EXE again. The exe is running perfectly with no errors.

 

I hope this answers your question.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 2 of 10
(7,870 Views)

Hi Alex

 

Thank You for the detailed answer and sorry for my late reply.

I've reckoned the issues regarding VI server and separated compiled code and VI in LV2011/LV2012/LV20xx

 

Your assumptions are correct. We develop Vision Test Systems using a plugin architecture. The system is a configureable framework based on VI server calls to plugins and modules.

 

To me and probably many others developing large application, upgrading to 2012 is a downgrade.

Not having the opportunity as an LabVIEW architect, to develop plugin or modular based systems using VI server in the run-time environment, thus still having the same VI hierarchy as in the development system, is a major drawback - in my opinion.

 

Why not make it an option to maintain the backward compatibility ?

I know this is a NI strategic decision but I can't find reasonable arguments for cutting out the well-proven VI server based application architecture.

 

1. I don't see how source code control, from a developers point of view will justify it. So I assume You mean to simplify NI internal source code control ? It makes perfectly sense having the hierarchy of Your apllication source code controlled using trunk and tags.

2. It is not a question about distributing VI's. Our use case involves calling VI lib files in the run-time environment on a development machine. Embedding i.e VDM in an application sometimes causes problems.

LabVIEW was initially developed as a tool for data acquisition and data presentation mainly for research and laboratory use. I don't think Jeff Kodorsky had the intention of making distributable executables and installers at first !

3. Windows is an OS, not a development tool

 

We are forced to upgrade due to improvements and new features of the VDM, but unfortunately we need to rework the framework to meet these contraints NI is forcing upon us. And it'll cost our customers huge amounts of money.

 

I've been working on distributing our main component of the framework as a source distribution. It is 1200 VI's plus all its VI lib dependencies. I did not succeed.

 

"Error copying files.
Source: C:\Program Files\National Instruments\LabVIEW 2012\menus\Categories\Mathematics\_elementary\Discrete Math.mnu
Destination: C:\Workspace\GVS_Framework (LabVIEW 2013)\GVS\Process Handler\LabVIEW\Process Handler - Source Distribution\Process Handler.llb\Discrete Math.mnu

Unknown LLB file type.

 

Error 1 occurred at AB_Dest_LLB.lvclass:Copy_File.vi -> AB_Source.lvclass:Copy_SourceItem.vi -> AB_Build.lvclass:Copy_Files.vi -> AB_Build.lvclass:Build.vi -> AB_Engine_Build.vi -> AB_Build_Invoke.vi -> AB_Build_Invoke.vi.ProxyCaller

Possible reason(s):

LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge."

 

Are there really no better ways to deal with these issues ?

 

Kind regards Kahr

Regards Kahr
Certified LabVIEW Architect
CIM A/S
Message 3 of 10
(7,813 Views)

Hi Kahr.

 

Regarding your failed source distribution have you remembed not to: 'Exclude files from vi.lib' in the Advanced Exclusions of the source distribution build spec?  - What Alex told you is the correct and officially supported way to do this. 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

 

 

 

 

0 Kudos
Message 4 of 10
(7,790 Views)

Hi Anders

 

Yes i did disable exclusion of VI-lib files.

As You can see from the error description, the process is aborted while copying from VI.lib !

Regards Kahr
Certified LabVIEW Architect
CIM A/S
0 Kudos
Message 5 of 10
(7,786 Views)
Solution
Accepted by Kahr

Hi Morten,

 

I just sent you an e-mail (before I saw your post) with some other information related to this.

 

Regarding the copying it looks like you have included a palette in your source distribution (mnu file), which won't work (sorry for not seeing this before).

 

Could you try to see if it unintentionally was included in your dependendies or anything? The mnu files behavior is also something that have changed from 2010 to 2011 so if you are running with the old project from 2010 there might be some bad dependencies. (We always recommend to create a new project when migrating a LabVIEW project to a newer version).

 

There is a little bit more information about the error you are seeing while creating the source distribution here:

 

How Can I Include .mnu Files in a Built LLB?

http://digital.ni.com/public.nsf/allkb/051F1533145089A1862578B80060D93B?OpenDocument

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

Message 6 of 10
(7,773 Views)

I am having the same problem.   I also use a plug-in architecture so including the subVI in the exe would defeat the entire purpose.

 

I have attached a very simple example that illustrates the problem and I have not been able to figure out a workaround.  This is a huge problem for me and I didn't realize that such a fundamental change has been made to LabVIEW 2012.  Hoping there is a solution!  I would just use 2010 or 2011 but there are unresolved bugs in those versions that cause other problems (specifically crashing due to the known bug in the XY plot).

 

For the example to work, put the TEST folder onto the C: drive.  It works fine when running in the LabVIEW enviornment but when running the executable, the subVI has a broken arrow.  It cannot find the NIDAQ VIs.  This has worked fine since LabVIEW 7.1.

 

0 Kudos
Message 7 of 10
(7,737 Views)

Hi Andy

 

Have you tried to create a source distribution with you plug-in VI's like Alex detailed described how to in the 2'nd post?

 

 

 

Best Regards

Anders Rohde

0 Kudos
Message 8 of 10
(7,715 Views)

I tried the source distribution as suggested and it solved my problem.  Thanks for everyone's help!

0 Kudos
Message 9 of 10
(7,668 Views)

Cool, good to hear.

 

Br, Anders

0 Kudos
Message 10 of 10
(7,651 Views)