12-12-2019 03:23 PM
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.
12-12-2019 03:32 PM - edited 12-12-2019 03:33 PM
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.
12-12-2019 03:39 PM
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!
12-12-2019 05:37 PM
You may want to look at "i poof vis" Dennis rocked that
12-13-2019 02:24 AM
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
12-13-2019 03:37 AM
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...
12-13-2019 03:53 AM
Here's how:
So now all you need to do is to put the VIs on the diagram!
12-13-2019 03:56 AM
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!