LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Include support file for a VI in the code

I have a working program. I am using a pre-programmed Excel file as a template to store data in my program. Right now I have it set such that I have a browse control which gives me the path to the test template.

 

It has been working ok for me, the problem I am facing is people edit the template and that kind of messes the way the spreadsheet reads the data.

 

This is one of the problems. But the point I am trying to make is, Is there a way I can store a support file in my code, so that I do not have to give a path for it every time?

 

http://digital.ni.com/public.nsf/allkb/2EBA44FCF6EF0F5686256A41005DA1F5

 

is one of the way to do it. This is when I am making an application out of it.

 

Moving on I need to recall a lot of different settings for Oscilloscopes and signal generators. It would really help if I can store a few of these setup files in my program.

 

0 Kudos
Message 1 of 8
(3,479 Views)
Hi nevil,
do you want an extra file or not? If not you can create an array of your data as a constant in your code. Try to use the same interface.

Hope it helps.
Mike
0 Kudos
Message 2 of 8
(3,473 Views)

I do not mind extra files. The templates are programmed quite a bit. To do tht part in LV will be very cumbersome.
Also Excel spreadsheet is just an example. I also need to recall files like scope setups which have different extensions and can not be read by labview directly, but there are tektronix drivers available which can read them.

I hope this is what you were asking Mike...Smiley Sad

0 Kudos
Message 3 of 8
(3,469 Views)
You can't "embed" the file into your VI, but you can include additional files into a project, and when you build the app you can include these files as "Support Files". This way your app will use the file you had in the project.
0 Kudos
Message 4 of 8
(3,463 Views)
In the vi, I am using the path to the support file(template) as a constant. I did include the template in the "Source Files" tab while building the application. Now when I run the application, it seems to me that the program looks for the template at the location I specified. If I do not have the template and the path structure I used as in the main vi, the application can't find the template.

Is there a way I can have the program use the support file?


0 Kudos
Message 5 of 8
(3,457 Views)
What I normally do in my projects is that I use an "Anchor" VI that I place in the root directory of where I have my project files. Then, all paths are constructed to be relative to that. When you create the application you just need to place the template file in the same location relative to the root directory of the app. For example, I have a "Config" directory that contains a bunch of configuration files. When I need to access a file from there I create the path by calling the "Anchor" VI, which returns to me the root directory, and then append "Config" and then the name of the file:



When the app is created I just place the "Config" folder into the folder where the app resides. This allows the VI to work whether it's in the development environment or running the app.


Message Edited by smercurio_fc on 07-02-2008 05:24 PM
Download All
Message 6 of 8
(3,430 Views)
It is stored in version 8.2. Can you please store the Anchor.vi as a ver 8.0?

Thanks,
Nevil
0 Kudos
Message 7 of 8
(3,418 Views)

Here it is in LV8.0

 

Message 8 of 8
(3,410 Views)