LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Modifying Several Similar VIs

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

Dan
CLD
Download All
0 Kudos
Message 1 of 7
(3,479 Views)
Message 2 of 7
(3,431 Views)

Do you know about LabVIEW Scripting?

 

BS

0 Kudos
Message 3 of 7
(3,398 Views)

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.

Message 4 of 7
(3,382 Views)

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

Dan
CLD
0 Kudos
Message 5 of 7
(3,361 Views)

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.

0 Kudos
Message 6 of 7
(3,274 Views)

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.

0 Kudos
Message 7 of 7
(3,181 Views)