LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the PC root directory in Labview

Hi. I have aVI that reads a Data file from a location on my Root diretory (C Drive). My problem is that the VI has a Path set to C:\ xxxxxx and if my root directory changes to D:\ for example i don't want to have to go into all VIs to change the Path. Is there a way, in Labview, of determining the PCs root directory in which i can add into my Path so as if the root directory changes it will still find the data file

0 Kudos
Message 1 of 6
(3,797 Views)

Hi mtmnd,

 

ever noticed the file constant palette? Ever read the help for "current VI's path"?

Best regards,
GerdW


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

Thanks for the reply GerdW.

 

I am currently using the "current VI s path function with the data file location stored in an .ini file in the same location as the VI.

 

My boss is not happy with me using this method (not sure why) so was wondering if there is another way of doing this.

0 Kudos
Message 3 of 6
(3,794 Views)

Hi mtmind,

 

two possible ways:

check.png

 

Maybe you should talk with your boss about his concerns?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,790 Views)

Thanks again GerdW.

 

I think I need to convince my boss that the way i am doing it is ok.

0 Kudos
Message 5 of 6
(3,786 Views)

...\vi.lib\utility\sysinfo.llb\Get File System Root Name.vi

Message 6 of 6
(3,757 Views)