From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I have my VI prompt me to create a file?

Solved!
Go to solution

So I have a block diagram that saves csv file every 30 seconds. So Before I even start running, I would like my block diagram to prompt me to  save a file by bring file explorer as shown below without messing up the functionality of my block diagram. I still want to be able to save the same file I am creating every 30 seconds.

GRCK5000_0-1652795421495.png

 

I try messing with the property of the base path. I'm still unable to have my VI prompt me. I have tried using case structure before to create an initial file on another code I have and it has never worked for me.

 

Can someone please help me?

 

0 Kudos
Message 1 of 9
(1,274 Views)

Have you tried an action engine? Create an INIT case and have it initialize the save file prompt. You would still need to run the VI but it would force the VI to ask the user if they would like to save a file and handle that action prior to any further movement.

Creig Mills
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 9
(1,265 Views)

You need to change the "browse option" (right-click) of your path control to allow selecting new files. (You currently have it to allow only the selection of existing files)

 

(You still use inner loops to gum up your dataflow. Just don't!)

0 Kudos
Message 3 of 9
(1,241 Views)

No, I have not. Does NI have an example for that?

0 Kudos
Message 4 of 9
(1,236 Views)

Good morning Mr. Altenbach

I tried switching to New and I still don't have file explorer prompted. 

GRCK5000_0-1652800879746.png

 

Yes, I have to stop using these inner loops. I'll just stick with state machine. 

 

0 Kudos
Message 5 of 9
(1,235 Views)
Solution
Accepted by topic author GRCK5000

That's when you would press on the browse button next to the path control.

 

To prompt the user at runtime, call the "file dialog" function where you have all the same options. Make sure to also handle the situation where the user cancels the file dialog.

Message 6 of 9
(1,225 Views)
Solution
Accepted by topic author GRCK5000

In my opinion, the "File Dialog" is a (the only) useful express VI. You can configure a starting path, default file extension, if you want to force a new file or allow an existing file to be written to/over, etc.

Message 7 of 9
(1,221 Views)

@StevenD wrote:

In my opinion, the "File Dialog" is a (the only) useful express VI. 


The file dialog was even nicer before they changed it to an express VI many version ago. I am sure that one is still hidden somewhere deep inside vi.lib. 😄

0 Kudos
Message 8 of 9
(1,218 Views)

Yes, it works fine now.

0 Kudos
Message 9 of 9
(1,190 Views)