LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing programmatically VI's

Until now we supplied a library called AqDx.llb which contains a lot of VI's with AqDx prefix in the VI's name, like AqDx Init.vi, AqDx Close.vi etc.
Now we want to supply a new generation of the library who was renamed to AqD1.llb and with AqD1 as prefix of VI's name, AqD1 Init.vi, AqD1 Close.vi etc.
It is possible under LabVIEW to replace programmatically in a VI all sub-VI's of the AqDx.llb library by the corresponding VI's of the AqD1.llb library ?

(AqDx::AqDx Close.vi --> AqD1::AqD1 Close.vi)

Briefly, we want to supply a migration tool to our custumer.

Thanks a lot in advance !
levent
0 Kudos
Message 1 of 5
(3,411 Views)

If you want to be safe, you can do the following:

  1. Open your program.
  2. Replace the prefixes for the AqDx VIs and save them (I believe I remember MGI as having a tool on their site to rename VIs, but if not you can write one on your own using the Save Instrument method).
  3. Since the main program was in memory, it should now be calling the AqD1 VIs, so you can close and save it.
  4. Now open your real AqD1 VIs.
  5. Open the program and it should load the AqD1 VIs which are already in memory (the real ones).
  6. Save it and you're set.

If you want to be more adventurous, you can try going to the LAVA forums scripting board and learning about the Replace method, but I believe the first method would even be faster to implement.


___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,395 Views)
In the past this was a pain to do, you had to do it manualy.
Now checkout the undocumented LabVIEW VI Scripting.
I made an simple experiment:
 

If you stick to documented LabVIEW, you can rename all old vi's to the new name ( using save instrument invoke node).
Then unload all callers and old from memory.
file copy then new vi's over the renamed old vi's.
Reload everything, now with the new vi's, and save.

Download All
0 Kudos
Message 3 of 5
(3,390 Views)
You beat me with six minutes!
0 Kudos
Message 4 of 5
(3,385 Views)
Very good job, it's seems that your solution is exactly what I expected to find !!!
I will try it tomorrow !
Thanks a lot !!!
0 Kudos
Message 5 of 5
(3,376 Views)