12-15-2023 08:35 AM - edited 12-15-2023 08:45 AM
Dear LabVIEW experts,
I am working on a project that requires me to programmatically rename the member VIs of a class without breaking the links. I have attached the sample class and VIs (LabVIEW 2017) for your reference. My current solution can rename the class VIs, but it breaks the links between them. How can I fix this issue? Any help or advice would be greatly appreciated.
Solved! Go to Solution.
12-15-2023 09:03 AM - edited 12-15-2023 09:09 AM
Hi Baji,
Without using a project, there is no way LabVIEW can detect the callers on disk of the renamed VIs to update their link. I suppose the private VI method you are using (Save.Instrument and Callers Debug) gets the callers from the owning project, but in your case there is none.
Try adding the callers of your class members, the class itself and the "Find and Rename" script to the same project, it will work better.
If you don't want to use a project, you will have to load all the callers in memory yourself before the renaming, then rename your member VIs, then save the callers, then close them.
Regards,
Raphaël.
12-15-2023 12:42 PM
When I use the Project Reference, I am not able to find "Find and Rename" script.
12-15-2023 02:06 PM
What do you mean by "the project reference" ? Create manually a project and add all the files to it.
What do you mean by "find "Find and Rename" script" ? I am speaking about your VI "Find and Rename.vi". I call it a "script" because it automates project / VI modification. Just run it again, it will work if everything is inside the same project.
12-15-2023 04:04 PM - edited 12-15-2023 04:06 PM
Thanks raphschru, this is my working solution
12-15-2023 04:17 PM - edited 12-15-2023 04:20 PM
Nice, some remarks on your code:
- don't forget to close project and selected items references when not needed anymore.
- you can merge your 2 loops in a single one.
- the open application ref is not useful. If you don't wire an Application property/method, it will already reference the owning application (where the script executes), and no need to close it, it is a static reference.