LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search automatically incorrect path mapped in 100 of VI's.

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 15
(2,873 Views)

Hi Aniket,

 

load your project, load the main VI and then use the search tool (Ctrl-F)…

(I would search for simple texts!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 15
(2,860 Views)

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...

0 Kudos
Message 3 of 15
(2,857 Views)

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

0 Kudos
Message 4 of 15
(2,829 Views)

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.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 15
(2,825 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(2,823 Views)

Yeah Blokk, it's bad.

I have to fix someone else code 😞 , also to add new features.

 

 

0 Kudos
Message 7 of 15
(2,821 Views)

@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.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 8 of 15
(2,819 Views)

Ok Gerd, i will try your method.

And, I was actually looking for some LV script to automate.

 

 

Thanks

Aniket

0 Kudos
Message 9 of 15
(2,816 Views)

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

0 Kudos
Message 10 of 15
(2,794 Views)