12-22-2014 03:55 AM
Hi,
I have several VIs that differ, but have broadly the same structure. Ideally, I would like to be able to programmatically apply the same mods to all these VIs. The mods I need include: adding front panel controls and indicators, changing what's connected on the connector pane, adding and connecting subVIs.
See my example VIs below for an illustration of what I mean.
Is this possible?
Dan
12-22-2014 10:46 AM - edited 12-22-2014 10:49 AM
Hi Dan,
maybe you already know VI scripting, but I'd suggest to give a look here:
http://zone.ni.com/reference/en-XX/help/371361L-01/lvconcepts/scripting_property_method/
and here:
http://zone.ni.com/reference/en-XX/help/371361L-01/lvhowto/scripting_tutorial_intro/
Regards,
Marco
12-22-2014 05:24 PM
Do you know about LabVIEW Scripting?
BS
12-22-2014 08:21 PM
How many VIs is "several"?
Unless you need to modify perhaps about 30 VI's or more, it would be quicker to do it manually than to write a VI script to do it.
With fewer, the only reason to script it would be to learn more about scripting.
12-23-2014 01:02 AM
Yes - it's more like 300 VIs that need modifying (hence my desire to find a shortcut!).
I have dabbled with scripting in the past (although I've never done anything much more involved than getting the names of cases from a case structure).
Dan
12-30-2014 07:33 AM
I know I am late to this party, but, if your changes are consistent, you may want to consider using the LabVIEW scripting engine. It adds code from a VI to existing code. It can connect connector panes and wire things up. It has a front panel cleanup, although you may not want to use that depending upon your current code. This engine is used by almost all of NI's shipping assistants (DAQ Assistant, Motion Assistant, Vision Builder, etc.). You can find documentation here.
01-06-2015 03:00 PM
Okay instead of being like the 5th person to suggest scripting, I'm going to show you the scripting involved in doing this.
Extract the zip and open the VI. Provide the path to VIs that are like the Before, and run it. It will edit the Before, then save it as a new file in the same directory as the before with the changes you showed. This assumes the same connector pane is used, it also assumes some structure (while loop for loop etc) exists, and that an "error in (no error) control exists with a wire attached to its terminal.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord