LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save file path once and keep on using for next time

1. want that when user first run the program, labview ask for file path. then save it as default path next time program run, unless user changes it to different file path.

2. Is there any example code by NI which i cna check?

 

Message 1 of 8
(1,539 Views)

I'm not sure that you can save stuff like this without writing it somewhere, but maybe i'm wrong and one of the more experienced guys will correct me.

 

That said, the way i have it set up is with a "Datalocation.ini" file, which is saved somewhere and shouldn't change. In this file is then saved a file path such as yours (or any number of other things).

Message 2 of 8
(1,502 Views)

+1 on what aero suggested-  there are examples on how to use the ini file vis too:

 

Configuration (INI) File.lvproj in the labview\examples\File IO\Configuration

0 Kudos
Message 3 of 8
(1,481 Views)

Unnecessarily complicated and generally not worth doing is to save it to some registry setting.  Just thought I'd throw that out there, for whatever it's worth.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(1,453 Views)

Check out the Configuration (INI) File-example

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 8
(1,420 Views)

No need to go down the INI file rabbit hole when a simple one line text file containing the path will work.

 

SnR.png

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 8
(1,407 Views)

@RTSLVU,

Thanks for replying. Can you attach the VI file of screenshot?

what block diagarm blocks it have?

0 Kudos
Message 7 of 8
(1,380 Views)

Hi Vindhy,

 

RTSLVU attached a snippet - look for "snippets" in the LabVIEW help!

 

(And all those functions are found in the file functions palette…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(1,378 Views)