LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I call arbitrary VIs based on control string?

Hi,

I'm completely new to the LabView scene (and I'm running v7), but I'm exploring around and trying to get various little things to work in this strange new, non-text-based environment. It is interesting, to say the least.

So here's a question for you all, and forgive me if it's completely dumb - can I call an arbitrary subVI based on name? I mean, adding any given VI to a block diagram is straightforward, but what if which VI I add is dependent on a text field? For example, say I have these two VI's, FOO.VI and BAR.VI. My MainLoop.Vi just as a string control for user input (Ideally, the user would enter FOO or BAR and not something else, let's just assume that for now). Now, based on what that string is, I want my mainloop to call the next VI; if the string is FOO, I want to call FOO.VI and if the string is BAR, I want to call BAR.VI.

Is this possible?

Hehe, thanks...
0 Kudos
Message 1 of 3
(2,599 Views)
Hello,

See if the quick made example it's clear for you.

I think that this it's what you want.
Software developer
www.mcm-electronics.com





PORTUGAL
Message 2 of 3
(2,582 Views)
Yes it is very possible and is one of the most powerful features of LV because it can be used in so many ways. For example, here is a discussion on using this capability to construct a test sequencer or executive. Be sure to check-out the example and documentatiuon that I uploaded. This discussion covers using the same basic techniques with template VIs (*.vit) to spawn multiple independent instances of the same code. Again, check out the code that was uploaded.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 3
(2,571 Views)