LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I programmatically load a sub VI into my code

Hi everybody,

 

I am developing a program for an automated test system to determine the cut off frequency of  low pass filters.The filters in question are simulated in labview as sub VIs  with two inputs (input voltage and frequency) and one output (output voltage.

 

I have already developed a program that can interrogate one filter and determine its cut off frequency.

 

My challenge is how to test any of the filters automatically without writing parallel codes for all of them.

 

Put in another way, I want the program to ask the user to load any of the filters (sub VI) from the desktop or from any other location so the the code I have already writing can interrogate the filters and determine the cut off frequency

 

Any suggestion will be appreciated

 

Thanks.

 

kaydgreat.

 

 

0 Kudos
Message 1 of 5
(2,766 Views)

There are a couple of ways to do this, depending on your ability. You can do it with a heirarchy of inherited classes, or a selection of VIs with the same connector pane layout. (These are basically the same; classes would be more manageable, and selectable VIs probably quicker to implement)

 

Search the example finder for 'plugin' to find a plug-in architecture of the latter of the above methods.

_____________________________
- Cheers, Ed
0 Kudos
Message 2 of 5
(2,756 Views)

Using classes will result in cleaner, smaller, easier to maintain, code than using multiple subVIs.  But it will take longer at the beginning and will take a bit more planning.

0 Kudos
Message 3 of 5
(2,741 Views)

Open VI reference -> Invoke node:Run VI (-> Close ref)

That way you can start most any VI programmatically.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(2,732 Views)

@DFGray wrote:

Using classes will result in cleaner, smaller, easier to maintain, code than using multiple subVIs.  But it will take longer at the beginning and will take a bit more planning.


Agreed. Classes will provide a more solid develpment platform.

_____________________________
- Cheers, Ed
0 Kudos
Message 5 of 5
(2,730 Views)