LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write Vi that creates a Vi

Hello,

 

As the subject states I want to make a Vi that makes a Vi.  My desired program would work as follows: Click Run, Vi prompts me for input (Vi names and control values).  After typing  the Vi names and values, a vi is created with the list of Vi in the order I listed all wired and ready to go.

 

Is there such a Vi function that when executed plops a Vi a into a block diagram and the error in terminal connects to the error out terminal of a specified upstream Vi?  If there is, is this function available in 2014 or 2016?  If not, do you have a proposed workaround?

 

Any help is greatly appreciated.

0 Kudos
Message 1 of 8
(2,503 Views)

Sounds like a job for VI scripting (which I am not very familiar with).  It may or may not be either doable or feasible depending on the complexity of the VIs to be created.

This will be no trivial undertaking.  (And if you had to ask how to do it, I'm not sure you are ready to code it.)

I know I am not ready to code something like that.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 8
(2,489 Views)

This could definitely be done with scripting, it sounds like a fun challenge. Take the challenge in small steps and you will gain a lot of scripting knowledge.  There is a lot to learn to get this working, but it will be satisfying to watch it code for you when it is working! Good luck, have fun!

0 Kudos
Message 3 of 8
(2,483 Views)

You may want to look at "i poof vis"  Dennis  rocked that


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(2,451 Views)

You can do a lot through scripting, you can start by looking here https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/scripting_adding_objects/

You can also open e.g. the quick drop VI's and see how they solve similar stuff.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 8
(2,366 Views)

Sounds like you want to put the VIs on the diagram, and than use the QD, CTRL+W logic to wire things together.

 

It's had to script anything 100%. Usually, 80% is good enough to reduce development time to 'just some details'.

 

If you can live with how QD, CTRL+W wires things, you're done. If not, you have a lot of work ahead of you...

Message 6 of 8
(2,334 Views)

Here's how:

Script to invoke QD CTRL+W.png

 

So now all you need to do is to put the VIs on the diagram!

Message 7 of 8
(2,330 Views)

BTW. Normally you'd do this with OO...

 

Make a "task" parent, and for each task a child. Then, from file, UI or whatever, make an array of tasks and call the "execute" method on them... Task specific settings can be set in a child specific init. IIRC, the command or strategy pattern, optionally combined with a composite.

 

The scripting solution won't work in executables!

0 Kudos
Message 8 of 8
(2,329 Views)