LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Lookup or referencing?

Hi

 

I'm looking for some guidance or information. I'm writing a program which is required to calculate the cut-off frequencies of a filter. I've got this piece working fine, however I'm trying to automate it somewhat.

I've several filter VI's that I need to analyse, only one at a time though. Is there a method of linking or referencing to the VI location so that I can create a front panel that requests the user to choose the desired filter, once chosen and the program is run it will then use this filter in the code.

I don't want to post my code as it's a uni coursework and wouldn't like it to be plagiarised. All i'm wondering is can it be done, and if so some guidance on how I would approach it.

 

Kind Regards


Danny

0 Kudos
Message 1 of 9
(2,636 Views)

Do you mean you want to call the VI dynamically? How you are planning to pass the data in and get the output? You can have a static VI reference of have the path of the VI and use the open VI reference primitive to open the reference and execute the VI. If you can provide more information we can get a more clear solution.

-----

The best solution is the one you find it by yourself
Message 2 of 9
(2,631 Views)
At the very simplest, you would connect the front panel control to a case statement. Place the subVI inside and you are done.

Pretty basic stuff. The are several free tutorials available. You should take a couple of hours for them.
Message 3 of 9
(2,630 Views)

Obligitory links to free training:

 

3 Hour Introduction http://www.ni.com/white-paper/5243/en/

6 Hour Introduction http://www.ni.com/white-paper/5241/en/

LabVEW Basics http://www.ni.com/gettingstarted/labviewbasics/

Self Paced training for students http://www.ni.com/academic/students/learn/

Self Paced training beginner to advanced, SSP Required http://sine.ni.com/myni/self-paced-training/app/main.xhtml

LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_Links

 

As the others have said the best way is the simplest.  Just call it as a sub VI with inputs and outputs.

Message 4 of 9
(2,618 Views)

Dennis

 

I've spend some looking at the tutorials, but i'll review some more. I see what your saying regarding the case structures, I could have a different case for each sub vi that could be called upon from the front panel.

My code is in flat sequence structures as it's run in stages to produce a frequency, it then passes on the information to the next structure and so on, this is to improve resolution and speed in finding the frequency. In that regard the sub VI's are referenced in each of the structures, I think that would limit my ability to use the case structure unless I use some other methodology for executing the code.

But thanks for the guidance.

 

Regards

 

Danny

0 Kudos
Message 5 of 9
(2,617 Views)

@dangrenade wrote:

Dennis

 

 I think that would limit my ability to use the case structure unless I use some other methodology for executing the code.

 


Like a state machine.  I think it is a CLAD question by NI, something like all sequence structures should be replaced with what design pattern?  The answer is a state machine which allows you to go back and reexecute states, or go to states in different orders, or abort early, where a sequence structure forces you to do one thing after another until the end.  If you only want to go to the 3rd state you can't in a sequence structure, you must go through all of them.

Message 6 of 9
(2,611 Views)
A flat sequence structure is almost never the correct way to program. A better design would be a simple state machine. There are examples and templates that come with LabVIEW.
Message 7 of 9
(2,608 Views)

Thanks

 

Found some tutorials to have a look at.

 

https://decibel.ni.com/content/docs/DOC-17005

 

Regards

 

Danny

0 Kudos
Message 8 of 9
(2,599 Views)

Is this for the same assignment as discussed here?

 

Look at the way the curve fitting VIs call a function VI. The method used there should work for calling your filter VIs.

 

Lynn

0 Kudos
Message 9 of 9
(2,526 Views)