LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically save with options

Is it possible to automate this LV 7.1 sequence, open a vi, save it with options, new location, preserve hierarchy, select the new location, potentially answer yes to overwriting previous versions, close the vi.  Doesn't seem that the ActiveX interface allows this, or I'm using the wrong activex class.
Message 1 of 9
(4,248 Views)
With 7.1 you're limited with respect to that. You can use an external automation program to accomplish that. Something like AutoIt, or something similar. Or, you can use LabVIEW 8.x, which allows you to create a source distribution build. Maybe it's time to upgrade...
Message 2 of 9
(4,244 Views)
You can do that, but saving an entire hierarchy isn't done autmatically.

What I would do is this:

Get all VI's in memory. This will provide you with a list of all VI's in
your tool.
Dynamically open the source VI.
Get all VI's in memory. Remove all the VI's from the previous list. Remove
all the VI's that are not in the source VI's directory (or sub directories).
Save all the VI's using some clever path changing algorithm. For each VI,
replace the root path with the destination path. Before you save the VI
there, you need to create the directory if it doesn't excist.

As an alternative:

Get all the source VI's by the directory hierarchy. Use a recursive file
list, with *.vi and *.ctl (and *.vit and *.ctt), dynamically open all those
VI's.

Or:

Open the main source VI, and get all it's subVI's (callees). Do this
recursivelly, and you have your list.

Regards,

Wiebe.


Message 3 of 9
(4,216 Views)

Hi Weibe!

 

I wrote on of those and you left out an important point. THe new VI's should be saved from the bottom of the hiearchy up. This was the callers don't have to be resaved.

 

Clone_VI_Hierachy.vi is the top level VI.

  

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 9
(4,204 Views)

"Ben" <x@no.email> wrote in message
news:1219749006995-767279@exchange.ni.com...
> Hi Weibe!&nbsp;I wrote on of those and you left out an important point.
THe new VI's should be saved from the bottom of the hiearchy up. This was
the callers don't have to be resaved.&nbsp;Clone_VI_Hierachy.vi is the top
level VI.&nbsp;&nbsp;&nbsp;Ben
>

True. The devil is in the details...


0 Kudos
Message 5 of 9
(4,193 Views)

OpenG builder started out as 'Save as with options...'

And takes care of the relinking.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 6 of 9
(4,184 Views)

TonP wrote:

OpenG builder started out as 'Save as with options...'

And takes care of the relinking.

 

Ton


 

True!

 

But both that and the coe I posted have benn rendered obsolete by the option in the project to do a "Save As >>> Duplicate hierachy to new location". Smiley Mad

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 9
(4,176 Views)
Looks like your code is 8.2 and I did say 7.1.    Guess I'll try writing it myself.  Thanks for all the suggestions in the thread.  One of these days we'll find the resources to upgrade to 8.x...
0 Kudos
Message 8 of 9
(4,164 Views)

What's  the difference between the clone and mutate options?  (To make sure I understand them.)

In Sort_Bottom_Up.vi in the for loop before the last one, it seems the unbundle by name pulls the same field twice, (either caller or callee, can't remember for sure and I've shutdown the VM where I have LV 8 installed), instaed of both.  This may be a bug.

Also, the code doesn't seem to handle templates, bombing when opening the first one.  Probably needs a "2" option in the multiple VI Open calls.

0 Kudos
Message 9 of 9
(4,135 Views)