LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating sub vis and projects

Hi, 

 

I am currently working on a project which involves a large chunk of Labview programming. I am new to Labview but am relatively experienced with C. I have designed an algorithm for C that I am currently trying to "translate" into Labview. The algorithm I have designed is a very modular piece of code, I have used a lot of smaller functions and called them in main rather than writing the entirety of the code in main. 

 

My problem is that I don't really understand the difference between Labview projects and using one main VI to call other subVIs. I am unaware of whether I would be better off using sub VIs held together in one main VI or would I be better to use a Labview project. I am on a very tight schedule as it is a rather large project so I don't have a lot of time to experiment with my code-writing. 

 

Does anyone have any advice on which approach is better/easier for an inexperienced user or if they are both pretty much the same?

 

Gillian

0 Kudos
Message 1 of 4
(2,158 Views)

My problem is that I don't really understand the difference between Labview projects and using one main VI to call other subVIs. I am unaware of whether I would be better off using sub VIs held together in one main VI or would I be better to use a Labview project.

You can start without a LabVIEW project and code the "VI tree". 

However, as soon as you want to build an application or library, you must have a project.

Hope this helps, Guenter

 

Edit: The "main VI" is the so-called top-level VI that you select as the starting point - just like in C, where each application starts execution at the function "main()".

Message 2 of 4
(2,151 Views)

Hi,

 

I would advise using a project, a project in labVIEW allows you to easily keep track of Vis, subVIs and variables which you can then access from the project explorer. It also allows you to easily generate documentation about your project and create an executable from your project. It's similar to using a project in a C based programming application to organise your header files and executables.

Joel G
Applications Engineer
National Instruments UK & Ireland
Message 3 of 4
(2,146 Views)

Projects and subVIs are completely unrelated concepts.

 

The project is a means of organizing all the parts of the system you need to develop a program and build it into an executable.

 

A subVI is just any VI which is used as a part of another VI.

 

You need both.  When you open LabVIEW to start writing your code, create a new project and then keep your main VI and all subVIs and other parts like customized controls in the project.  Since you are an experienced programmer and have a modular design for the implementation of your algorithm, you can move those concepts directly to LV.

 

SubVIs should be logical groupings of code such as the smaller functions in your algorithm.  The entire algorithm could be contained in a subVI which has those functions as subVis in the algorithm VI.

 

Lynn

Message 4 of 4
(2,132 Views)