LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What precautions should I take with copying labview code from one vi to another?

I've got two vi's and I'd like to copy code from one vi to the other one to avoid having to manually recreate it in the target vi. The VIs have identical filenames but they're used for different applications so there are slight differences.

I've been trying this and getting lots of LV questions about saving other vi's when I try to close the vi into which I pasted the code. Apparently,

If a subVI is among those items copied/pasted, I believe I need to rightClick/replace the (pasted) subVI with the correct one in the file structure. (SubVIs for both VIs have the same filename.) Doing this seemed to reduce the number of files that LV asked me to save.

Also, if I copy/paste global variables, how can I be sure they're now linked to the correct global vi?

Any general comments or precautions concerning this type of operation are also appreciated.

Thanks,

Jeff
Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 3
(2,242 Views)


@JeffreyP wrote:
I've got two vi's and I'd like to copy code from one vi to the other one to avoid having to manually recreate it in the target vi. The VIs have identical filenames but they're used for different applications so there are slight differences.

I've been trying this and getting lots of LV questions about saving other vi's when I try to close the vi into which I pasted the code. Apparently,

If a subVI is among those items copied/pasted, I believe I need to rightClick/replace the (pasted) subVI with the correct one in the file structure. (SubVIs for both VIs have the same filename.) Doing this seemed to reduce the number of files that LV asked me to save.

Also, if I copy/paste global variables, how can I be sure they're now linked to the correct global vi?

Any general comments or precautions concerning this type of operation are also appreciated.

Thanks,

Jeff




Why don't you just save the vi in a different location or with a slightly different name and have two copies of your original code then just make the changes to the one that are needed? Seems that way all the code is there already waiting for your adjustments.

Gary
0 Kudos
Message 2 of 3
(2,233 Views)
Thanks Gary.

I can't save the vi to a new location because there are 'subtle' differences and the vi complexity is of such a magnitude (the code changes are a small percentage of the overall VI code content) that I'd spend a lot more time searching for those differences. In order to maintain the target vi's configuration, I need to make only those changes that are required by the change process.

There are some new VIs that I need to duplicate so I should be able to just save them in a different location and then change notes and other documentation subleties as required.

Back to the subject of copying code. In the extreme case, I could manually recreate the code. I'm hoping to discover a semi-automatic process, where I could copy the code, paste the code, then 'replace' subVIs and other such pieces of code, as necessary to re-establish links. I just spoke with a co-worker on this subject and he says he'll give me some guidance.

Thanks again,

Jeff
Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 3 of 3
(2,223 Views)