09-09-2005 02:44 PM
I would like to programmatically call (load and unload)
subroutines from a VI. There must be a way to do it, but I haven't quite
figured it out.
First the scenario:
ABSTRACT SCENARIO: I have a LabView VI that will end up being compiled into an
EXE. In this VI, I have a file list (Array) of which I will pick one file
each pointing to a VI. I plan on using a Menu Ring that selects one of
the options from the file list and then runs the corresponding VI. I
would like to be able to add or remove
SPECIFIC SCENARIO: I have a measurement program that controls (adjusts
settings/returns readings) external equipment. I would like to be able to
change the piece of equipment and simply change a measurement subroutine so
that I can "drop in" different modules for each power meter, using
the same main program. I would like to programmatically load and unload
these depending on usage. After compilation of the main program, I would
like to be able to add/change/remove subroutines to accommodate different
equipment.
When I compile the main program, if I compile the supporting VIs, I am no
longer calling
I thank anyone sincerely for their feedback.
09-09-2005 03:15 PM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
09-09-2005 03:44 PM - edited 09-09-2005 03:44 PM
Message Edited by Robert.Bedford on 09-09-2005 03:49 PM
09-09-2005 03:56 PM - edited 09-09-2005 03:56 PM
A few points of my own. If, when you say compile, you mean build an ".exe" that is really "building an application", which takes the vi's in your program, essentially builds them into a ".llb" type file, removing diagrams and front panels from all but those that display user interfaces at runtime. When you run the resulting .exe file it is loaded by LabVIEW, the runtime engine version if the development system isn't installed, and I believe compiled at that time. When you run a VI during development, the time delay before running the first time is LabVIEW compiling the code. If you stop the VI and rerun it you will see that it starts running much more quickly the next time.
You can build a structure that dynamically loads called vi's. Depending on the complexity of the called "plugin" there may be a delay before it executes, but it should be pretty brief, partly time to read it from disk, partly to compile the vi's code. I'm pretty sure that subsequent calls to that vi will be essentially instantaneous. Attached is a snip from some of my code that preloads the names and filepathes of vi's that may be run into two arrays and then when a specific vi name is called indexes the filepath based on the name. The VI plugins have to meet the criteria of having identical connector panes in this application, so you would need to develope an architecture that allows that.
P.M.
Message Edited by LV_Pro on 09-09-2005 04:58 PM

09-09-2005 03:57 PM
09-09-2005 04:55 PM