06-21-2011 04:29 AM
Hola
es una pregunta muy corta pero enrevesada.
¿como puedo llamar a varios VI's desde otro VI's generico?
Realmente lo que quiero conseguir es algo que sea fácil de poner y quitar subprogramas, para correr.¿ No hay ninguna forma de llamarlos sin que estén en el propio sub VI’s?
Mi idea es que un programa general que sea capaz de llamar a otros subprogramas (que no estén en el propio subVI’s) en forma de un ciclo. Explico esto de ciclo. Por ejemplo le digo al programa general que me haga correr el subprograma 1 , 2, 3 , 4 y 5. Cuando acaben todos los subprogramas sus tareas, le digo que vuelva a correr. Y así sucesivamente.
Muchas gracias
06-21-2011 04:53 AM
Hi JLAR,
Can you attach your post as I am not sure what you are trying to do. If you just want to call some VIs into your main VI dynamically without making them SubVIs, you can use a Property Node to call them dynamically. See the attached VIs for more information.
To call them multiple time you can use a While loop around the code with a stop button. If you want to call them multiple times on some condition, you can use a simple state machine.
Regards,
Nitzz
(Give Kudos to Good Answers, Mark it as a Solution if your proble is Solved;))
06-21-2011 10:06 AM - last edited on 06-21-2011 11:20 AM by Laura F.
In answer to your question: Yes, this is possible. What you want is the demo VIs that go with this script:
http://www.scribd.com/doc/57304415/Design-Patterns-and-Object-Orientation-Demonstration-Script
I don't know where those are actually hosted and Google wasn't any help to me in finding them. If I find them later, I'll post a link. In the meantime, reading the script I just linked to may be helpful (but it may just be confusing if you don't have the demo VIs to go along with the script).
06-21-2011 03:25 PM
Here! I found it!
06-22-2011 04:22 AM
HI NitzZ:
Thanks for your answer.
I attached a drawing, because I didn’t explain well. It explains what I want to make.
I want to make a VI’s which call to others VI’s. These VI’s make their functions when the principal VI’s is running.
I have the programs made, but I can’t call the programs.
Here is in Spanish.
Quiero hacer un VI’s que me llame a otros VI’s y que estos realicen la función que tiene que hacer.
Tengo los programas hechos pero no sé cómo llamarlos para que hagan sus respectivas funciones.
Thanks for your help
06-22-2011 04:24 AM
Aristos Queue
Thanks for your answer
02-11-2020 02:56 AM
Hi JLAR,
I am trying to do the same. Finally how did you get it done?
Could you help me please
02-11-2020 03:06 AM
Hi 99,
I'd suggest taking a look at these links:
Dynamically Loading and Calling VIs
Quickly Calling VIs Dynamically in LabVIEW (this actually does something a bit different, but I'm including the link so you're aware of it. Note it probably is NOT what you're looking for)
The first link discusses dynamically loading and then calling (who'd have guessed?) VIs on a calling VI.
This allows you to vary the behaviour of your system, provided your VIs have equivalent connector panes.
You could also consider using Dynamic Dispatch and object-oriented programming to vary the implementation using something like the Factory Pattern if you need multiple implementations, but for the same basic idea.
Don't do this if you want to do completely different things (see Liskov Substitution Principle), except if you can label the action something like "Take Action.vi" and have each child only perform a specific action (this is the Command Pattern, you can read about the use of this with Actor Framework in LabVIEW, see "Do.vi" for messages).