07-05-2017 02:18 AM
Hi,
I have a query or rather asking for a solution or methodology regarding how to solve incorrect path being mapped.
How to search automatically within vi's (need for 1000's of vis) if the path is mapped correct or not.
Suppose in 1 vi path is mapped to some server path eg : R:\Aniket\ New Folder and i want to change it to my local drive eg : C:\Aniket\Desktop\ New Folder, and i need to to this in 1000's of vi - is there any way to do this.
Also, for that i need to first look whether vi's use "file path" in building the block diagram or not.
Thanks
Aniket
Solved! Go to Solution.
07-05-2017 02:39 AM - edited 07-05-2017 02:39 AM
07-05-2017 02:44 AM
It was a really big mistake to "hard code" absolute path info into VIs. Instead, you should provide path info to your subVIs via connector pane controls!
Anyway, the damage is already done.
Regarding to your question, I think you can do what you want using scripting, but I have zero experience with it. Someone might come and help with more knowledge about scripting...
07-05-2017 04:21 AM
Hi Gerd,
I did not get you,and i have many vi's which needs to be taken care of incorrectly mapped path.
At one short is it possible to look for the path in vi, and replace it with new path?
Regards
Aniket
07-05-2017 04:24 AM
While you are doing whatever method you chose, you might want to think about replacing the path constant that you have incorrectly mapped with a subVI that contains the constant. That way, when it changes again you can quicly effect the change everywhere at once.
07-05-2017 04:25 AM
Hi Aniket,
is it possible to look for the path in vi
Use the search tool as suggested before! This way you can manually search for all references of your path and replace them with a new path (manually).
When you want to do this programmatically you need to use LVScripting!
07-05-2017 04:26 AM
Yeah Blokk, it's bad.
I have to fix someone else code 😞 , also to add new features.
07-05-2017 04:27 AM
@Blokk wrote:
It was a really big mistake to "hard code" absolute path info into VIs. Instead, you should provide path info to your subVIs via connector pane controls!
Anyway, the damage is already done.
Regarding to your question, I think you can do what you want using scripting, but I have zero experience with it. Someone might come and help with more knowledge about scripting...
You seem to be making the assumption that the OP has written rather than inherited the code requiring the change - not very fair.
Although I would agree that scripting might be the way to go, it does depend on the magnitude of the task as by the time the script has been developed and debugged, then in most cases (for a newbie to scripting, on a mid-sized project,) Gerd's find tool will have solved the problem in less time.
07-05-2017 04:44 AM
Ok Gerd, i will try your method.
And, I was actually looking for some LV script to automate.
Thanks
Aniket
07-05-2017 05:18 AM
I tried your method but instead of searching the path text, it is searching for the vi's name in the project. So, how to search inside the vi is my doubt here.
Regards
Aniket