07-09-2014 11:39 AM
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
07-09-2014 11:46 AM
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.
07-09-2014 11:46 AM
07-09-2014 11:56 AM
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/ma
LabVIEW Wiki on Training http://labviewwiki.org/LabVIEW_tutorial#External_L
As the others have said the best way is the simplest. Just call it as a sub VI with inputs and outputs.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-09-2014 11:56 AM
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
07-09-2014 11:59 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-09-2014 12:00 PM
07-09-2014 12:09 PM
Thanks
Found some tutorials to have a look at.
https://decibel.ni.com/content/docs/DOC-17005
Regards
Danny
07-13-2014 09:53 AM
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