04-25-2012 09:59 AM
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.
04-25-2012 10:21 AM
@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.
04-25-2012 10:26 AM
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.
04-26-2012 04:56 AM
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.
04-26-2012 08:20 AM
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.
04-26-2012 08:52 AM
Ok I got it. Thank you for helping. It worked!! 🙂