02-06-2012 11:03 AM
Hi,
Just in the process of upgrading our software from 8.6 to 2011. One issue we are having is references seem to be different for old code. Example - If we create a new control reference, put it next to the old one, put a probe on them both, the references do not match when we run the vi.
This causes havoc with our very large amounts of code. We've contacted NI though our support subscription and they required an example which we can not really give.
Anyway...
I thought I would write a scripting vi to replace all the old references from our code with new references.
Problem is I can not replace a Control reference easily that is inside any kind of structure.
I need a way of getting a reference to a parent strucure, I can then add it to the structure.
This will be run on large amounts of complex code, so it needs to be versatile. Please see the attached Vi's
Thanks
Joe
Solved! Go to Solution.
02-06-2012 11:11 AM
Here's the attached Vis in picture form:
02-06-2012 12:34 PM
I would make the following changes:
Let me know if you have any further questions. As far as I know, all the properties/methods I'm using in the code above are available in LabVIEW 8.6.
02-06-2012 03:46 PM
I'd try the Replace method personally.
My sense is that simply relinking each one to its own control might be enough, but I do not have a buggy VI to test.
02-06-2012 03:48 PM
One issue with Replace is that it will sometimes try to preserve settings and flags of the old item in the new item. It sounded like the OP's issues may have been related to something on the original control references getting corrupted, so I figured a wholesale delete/re-drop might be in order here.
02-06-2012 04:07 PM
Probably true. When I find myself in this situation I usually like to find the minimal change I have to make to fix the bug. The wagering side of me thinks that relinking alone will suffice as it has cured a few wonky things for me in the past.
02-08-2012 02:52 AM
This is perfect thank you.
I did try the Owner property but only on a property node and it was read only. But using the move method allows specification of the owner, which is exactly what I needed.
Thanks,
Joe