LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create file errors

Solved!
Go to solution

Could you please fix my vi to be able to create a new file automatically, when the path is empty? because I have no idea how to do that.

 

Thank you so much!!

 

What is the major problem of using locals? You are likely to recommend not to use locals as much as possible. I used some locals in my vi because I tried to wire it up already but it didn't really work well.

0 Kudos
Message 11 of 16
(1,098 Views)
Solution
Accepted by topic author Bombbooo

@Bombbooo wrote:

Could you please fix my vi to be able to create a new file automatically, when the path is empty? because I have no idea how to do that.

Fix, no.  Tell you how to fix, probably.  I mentioned the Is Empty String/Path function.  Did you use it?  If you have questions on how to use, feel free to ask.  I also mentioned the File Dialog from the FileIO->Advanced Palette.  Give that a try.

 

Thank you so much!!

 

What is the major problem of using locals? You are likely to recommend not to use locals as much as possible. I used some locals in my vi because I tried to wire it up already but it didn't really work well.

The major problem with using locals is that they break dataflow.  If it didn't work properly when wired up, it points to possible misunderstandings of dataflow programming.  Addressing and fixing these misunderstandings will serve you much better than using locals.  While locals can often be used to get the job done, they are not very maintainable and can lead to race conditions if not used properly.  It's much easier to learn how to properly wire for dataflow than it is to learn all the nuances of locals and race conditions.


 

Message 12 of 16
(1,093 Views)

There have been numerous examples posted on how to automatically create file names. You can base it on the current date/time or any number of other schemes. Do a search.

 

The major problem with locals is race conditions and each local makes a copy of the data. Your use of the locals seems to be just because you do not want to use wires - a silly excuse.

0 Kudos
Message 13 of 16
(1,090 Views)

This is what I have got but the problem is ; when the dialog box pops up to ask to put a file to be saved, the file you choose or create doesn't appear in the file path on the front panel. Supposedly the file path is empty and choose the file to save from the dialog box, it doesn't appear in the file path.

 

labview 7.jpg

0 Kudos
Message 14 of 16
(1,068 Views)

How do you want the user to select the file path?  Do you want them to enter it into the Front Panel Control or do you want to have them enter it in the pop-up File Dialog?

 

From the looks of what you've wired up, you want the user to select the initial search path on the Front Panel and then have the popup dialog.  If you want to display the actual filename, you should add a Path Indicator which displays the result of the File Dialog.  At the moment, you aren't wiring the result to any indicators.

0 Kudos
Message 15 of 16
(1,060 Views)

Ok I got it. Thank you for helping. It worked!! 🙂

0 Kudos
Message 16 of 16
(1,056 Views)