LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Source Distribution and Application Builder with a large project?

Hi,

I have a very large project I have converted from LV 7.1 to 8.2 and it needs a new exe and distribution packaging. Tutorials are nowhere to be found and the help files for the Source Distribution and the Application Builder are horrific, the behavior of the tools is unpredictable at best. I wanted to find out if someone could point me in the right direction or provide a step by step guide on how to PROPERLY create a small executable which will dynamically call the main application's VI, automatically include vi.lib/user.lib in the source distribution, etc.

Here is what I'm doing right now, the problems I'm having and questions. Thanks in advance.
-----------
Requirements:

1. The application consists of several hundreds of VIs, PDF help files, .DLLs, custom display templates (VITs).

2. The way I need the application to compile is to have a small .exe which dynamically calls the main application VI.

3. I need vi.lib/user.lib to be included in the distribution and dynamically stripped, unnecessary files removed.
------------
Current actions:

1. I create a small .exe file which calls our splash vi which in turn calls the main application VI dynamically.

2. I create a source distribution and uncheck the exclude vi.lib and other lib files.

3. I want to preserve the hierarchy.
-------------
Issues:

1. VI.LIB gets placed in the "(built directory)\Program Files\National Instruments\LabVIEW 8.2\vi.lib".

Will this create an issue with linking? My application currently points to: "C:\Program Files\National Instruments\LabVIEW 8.2\vi.lib".

We're using InstallShield to distribute the application and will the user have an issue with vi.lib location if he chooses a custom installation and points to a different drive letter for example or entirely different location?

Is there a way to specify where you would like the vi.lib to go when you build a source distribution?

2. The way I build the application works fine on the dev machine but on a clean machine after installing the RTE, I get the dreaded Error: 1003 broken node, etc. The Vi it points to is not broken and works perfectly fine in the dev environment. I'm aware of the pathing of the built applications, i.e example\test.vi in dev move VS the example\test.exe\test.vi in run time mode and strip the path accordingly.
--------

Help is greatly appreciated.

Message Edited by romulus on 02-20-2007 10:11 AM

Message Edited by romulus on 02-20-2007 10:11 AM

0 Kudos
Message 1 of 10
(5,761 Views)

If you still have the build spec file from the 7.1 application build, you can use that to create an 8.2 build spec that should be pretty close to what the 7.1 build was.

Look in the 'Tools' menu and select, "Convert Build Script..."

A Wizard will step you through the process.

Give that a try and let us know if you need any more help.

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 10
(5,734 Views)
Thanks, but that's not the problem I'm having. I have no problems creating the .exe, that's not the problem, the .exe is just a simple dynamic caller to the main vi. The problem is with source distribution app of 8.2 as I've stated above.

Message Edited by romulus on 02-20-2007 01:52 PM

0 Kudos
Message 3 of 10
(5,722 Views)
Sorry, I misunderstood what you are trying do.
 
So you're building a small launcher executable that is calling VI's that you are trying to assemble into a directory structure using a "Source distribution" build spec?
 
If that's the case, I'll try and give a few tips to get you going.
 
First, you normally don't need to include anything in the vi.lib. As far as I know, everything in this directory will be included when the appropriate driver is installed. Most of it with the Runtime Engine, DAQ VI's with DAQmx and so on. I've never tried a setup like you are doing, so I don't know if the distributed VIs can use the "Runtime Support VIs". You do run the risk of cross linking files any time you have duplicate file names. While in the development environment, LabVIEW will first look for a subVI in the place where it was when last saved. If it can't find it there, it starts looking through the Search Paths as configured in the LabVIEW options.
 
I have not used Installshield so I'm not going to be much help there. There is not a way to specify where to put vi.lib in the distribution. I don't think you'll have an issue with a different install path as long as you use relative paths.
 
Your issue #2 is probably because the vi.lib is not in the "default" location and it simply can't find them. Possibly Installshield could place the vi.lib files in the same location (C:\Program Files\National Instruments\LabVIEW 8.2\vi.lib) as on your development machine.
 
I hope some of this helps. Let us know how it goes.
 
Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 10
(5,710 Views)
Ed,

Thanks for your help! I've now finally gotten it to work after much headache (a week to be exact). So I guess my main issue now is this:

i. When my application runs in dev environment and I use say the FFT Analysis.vi from the DSP group, my app knows to find it automatically at the (vilib)\National Instruments\LabVIEW 8.2\vi.lib\Analysis\xxxx.llb.

So I never explicitly told my app to use relative or absolute paths in that regard. So the question is, when I use source distribution and it automatically creates a vi.lib in "C:\(my test app dir)\Program Files\National Instruments\LabVIEW 8.2\vi.lib". Is my application now properly and automatically linked to look in that directory? (I accomplish this by unchecking the Exclude vi.lib checkbox in Source Distrib options).

I will probably have an answer soon when I ghost my mule machine and run the app there, but it would be nice to have an official response.
0 Kudos
Message 5 of 10
(5,704 Views)

I unfortuantely don't have an answer for that question. I've never tried to include the vi.lib files in a distribution. I've always relied on the support from the corresponding driver.

Maybe some one else has done this and has some info.

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 6 of 10
(5,701 Views)
Dear Ed,

Actually with 8.2, dynamic inclusion of vi.lib is now automatic. The source distribution application goes through your app and automatically finds which components in vi.lib you're using and includes that in a realative path in your release directory for your application. We've done this for a while ourselves with LV 7.1 using our custom tools but it's now automatic and is included. We're not using any drivers as we're working with sound cards and have a custom .dll written to handle that.

Also we never used the RTE to get the app to run as that's not necessary, the RTE is way too big and all you have to do is include a few .dlls from LVs directory like lvrrt.dll and a few others and it'll run just fine without the RTE on the system.

So i guess the question still remains if my app will know about the new location of vi.lib that Source Distributor created. Thanks.
0 Kudos
Message 7 of 10
(5,699 Views)

My best answer would be if you were able to have this confiuration in 7.1, I would think it would also work in 8.2. But, as I've stated, I've never tried this, so I don't know for sure. I guess one thing you could do is use the tools you built for 7.1 to create your distribution for 8.2. This way you would end up with the same file structure as you've always had. Shouldn't be a problem then.

I agree the RTE's are too big. And they just keep growing. With LabVIEW 6.1, I could put the required .dll's and resource files on a CD with an executable and have an autorun file that launched the executable directly from the CD. Worked great for sending out demo's to customers. I haven't tried that with anything newer. I just haven't had the need to.

There is actually a smaller version of the 8.2 RTE (32meg vs. 94meg) that is intended for viewing Remote Front Panels in web pages. It does not contain the full run-time engine, but will allow some executables to run. You may be able to use this smaller RTE since it sounds like your application is pretty basic. This smaller RTE cannot be included in a LabVIEW built installer, but since you are using Installshield, you should be able to use that to install it. Look here for details and to download.

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 8 of 10
(5,686 Views)
Thanks Ed,

Yeah i've looked at the different RTE sizes, unfortunately b/c of the complexity of our application, we need the whole thing.

Also, using the custom tools with 8.2 is no longer possible since 8.x+ began using a strict, passworded .lvlib files like NI_AABPro.lvlib & NI_AABBase.lvlib which contain all the files that we're using for the app, if you try to manually rip out the function you want, it creates problems and LV complains. It is also something I want to get away from b/c doing custom things is not always a good thing since if a new version of LV comes out, you end up with an outdated set of functions/features.

Like I said, it's pretty easy to get away from the RTE by including a dozen of .dlls.

The issue is that our app allows users to write their own custom VIs which play with our application's memory list for example. If the user writes a custom VI and then tries to interact with our application (his VI has to be in our app's dir) what happens to the vi.lib associations? Will LV look into the relative path in our app's vi.lib or the real path of vi.lib? I'm afraid there are some horrors awaiting the user there (like LV breaking b/c of cross linked libraries).

Thanks for your reply.
0 Kudos
Message 9 of 10
(5,679 Views)

Dear NI Forum:

I have a similar sounding very large scale project with similar issues.   I find the new 8.2 builder dreadful. 

Because my current project is large scale and must support multiple parallel operating instrument drivers in a robust manner I have modelled it as a main EXE which serves only to read the base configuration files and dynamically launch a series of base services that all instruments need such as error handling, external TCP comms, data logging, H/W watchdogs, etc. and a series of instrument drivers that can all be launched, operated in parallel and then stopped "on demand".

All messaging between dynamically launched VI's and betwen dynamically launched VI's and the main executable is performed using these remote queues.  Internally in any given dynamically launched VI, local  queues may also be employed if the back panel diagram contains two or more parallel loops .

An outbound comms server simply accepts all acquired data messages from the various instruments and services as it arrives, formats it and sends it on to the VB U/I via its client connection to a socket server in the VB code.

Finally each dynamic VI operates in its own separate thread which also serves to make the whole system

Given this flexible architecture, then my objective is to have a single VI in my executable with no explicitly named dynamically launched VI's and yet be able to dynamically launch VI's using path information stored in an XML file that I have created.  This is more flexible in that it allows me to change or add the software without having to issue an entirely new build.

The dynamically launched VI's and their dependent sub-vi's are stored in a source code distribution build.

The installer then includes the EXE and the source code distribution build and installs them in the Program Files directory.

If I later create a new driver for my project then I should simply be able to create a source code distribution folder for that new instrument only and include an updated XML configuration file and the old exeecutable that is already installed should then be able to work with the new driver without requiring any further modifications.  This is important in isolating the effects of any code change or expansion to the new code only and insuring a high degree of reliability.

At least that is supposed to be the plan.  It all worked beautifully until I tried to create the installer and source code distribution files.

Unfortunately I keep running into various issues with the various builders such as:

1) I am using subversion for my source code control tool.  It creates files that are very similar to the actual VI's except that it attaches .base-text to them so that in addition to abc.vi existing, another file called abc.vi.base-text exists.  The builder misidentifies the .base-text file as a VI because it apparently is doing a substring match on ".vi" rather than checking to insure that the last three characters ARE .vi.

2) I worked around the SVN problem by creating a separate parallel copy of the code that is NOT controlled by SVN but this means double work because any fixes I do in the uncontrolled code have to also be updated in the controlled version.  This effectively defeats all the benefits of source code control.

3) Paths for the dynamically launched VI's and XML file differ between the source code version and the executable version.  I had to write a program to test whether I was in source or exe mode and use different base paths accordingly. 

4) LabVIEW keeps cross linking VI's when I run builds and/or run the executable while the project view is open so that my original source code VI's become linked to VI's in the source code distribution library that I am creating, either in the builds directory or in the destination "Program Files" directory.  This leads to the dreaded "1003" error and I have to hunt down these relinked VI's and put their paths back to where they belong.  This is very erratic and hard to prevent.

5) The dependency node on the project view tree allows you to open and browse through the dependent files and acts as though those dependencies are manually editable so that you could manually remove a dependency if you so choose and even prompts you that removing the dependency from the project does not remove the VI from the disk.  In reality, however, removing VI's, DLL's, or other files from the dependency subtree of the project view does absolutely nothing.  They still end up being included in the source code build distribution.

6) This dependency problem is important because the source code distribution node arbitrarily takes it upon itself to include DLL's not part of the main directory hierarchy of my project and replicate them where IT wants rather than where I need them to be.  For instance, I have DLL's located at C:\abc on my machine as opposed to C:\MyProject\...  When the source code distribution builder creates the distribution build it creates a parallel directory to MyProject called abc and puts a copy of the original DLL into that parallel directory.

This creates serious problems for me because my application must work with other applications and share the same instance of that DLL, not two separate DLL's with the same name but different paths.

It also poses a problem for code maintenance, what happens if the vendor who shipped me that DLL as part of their hardware driver issues an upgrade?  Then I have to create a separate upgrade installer to copy that DLL over to the NI copied DLL.

7) Trying to remove these parallel folders containing the duplicate DLL's from the destination directory pane of the Installer builder after copying the source code distribution over from the source to the destination panes "breaks" the builder dialog.  It removes my source code distribution directory name and promotes the sub directories underneath it to the next higher directory level - at least that is what is indicated by the user interface.  In reality what happens is that removing one of these parallel folders removes my source code distribution folder entirely from the build.

😎 Dependent VI's located in user.llb, vi.llb, and instr.llb will necessarily be part of the source code distribution because they are contained as sub-vis of my dynamically launched vi's.  If I un-check the "exclude" check boxes for these libraries to force their inclusion in my source code distribution, then it WILL build an installer - however if you try to run that installer, it will crash in the process of installing the program and present you with a cryptic and unexplained MSIExec error which you have to research at msdn.microsoft.com and even then you will learn very little about what is wrong with the installer that was created. 

If National Instruments is going to use MSIExec as the engine under it's installers "hood" then it needs to provide graceful ways to handle installer exceptions and it needs to provide meaningful error messages that developers can use to troubleshoot and debug any installer errors.  Currently there is NO available documentation on this subject at NI.com and the attitude seems to be that the installer will always behave properly and that there will be no errors.  The available information on the installer is limited to the patently obvious and is all but useless.

9) Because it is undesireable for my architecture to be forced to declare my dynamically launched VI's as such when initially creating my executable, the source code distribution and dependency walker don't seem to understand whenever I am forced to create a new sub-vi in my project to solve some issue I encounter.  The executable builder and the distribution builder and the installer builder happily create their updated targets without the new sub-vi and the frustating thing that occurs is that a perfectly fine source code VI in the source code directory will not work properly when dynamically launched from the destination directory when in executable mode because it will be missing the necessary new sub-vi.  This again results in the dreaded "1003" error .

The only way to overcome this problem is to manually add each new VI to the project VI.

I have been working with the help line on these issues for the last week or so and some of these problems have been "worked around" at this point but I think that NI's development people ought to take a look at how to resolve each of the above described problems in a systematic method that is not so painful for their customers who are doing large scale development with dynamic VI's ASAP.

I would be happy to hear any suggestions anyone has to offer me regarding how I can "have my cake and eat it too" in my project, i.e. does anyone know of sure fire ways to work around the above problems so I don't have to substantially modify my source code and/or dump dynamic VI's?

Thanks,

Doug De Clue
Instrumentation Programmer/Test Engineer
DME Corporation, Inc.
Orlando, FL
ddeclue2@earthlink.net

Message 10 of 10
(5,608 Views)