10-15-2010 12:38 AM
Hi
I am using the open/create/replace file function with a default name as input. This default name is unique for everytime the vi runs because it includes the date and time.
When using function as create , open or create , create or replace: In all 3 cases, it prompts first for the path and then later asks for file replacement.
I am trying to avoid the replacement question which pops up even when the filename is unique and function is selected as create.
Has anyone faced this issue before?
Thanks!
Vaney
10-15-2010 01:10 AM
That sounds very weird, are you positive you only call this function once?
I would try to place a breakpoint on the after the 'replace or create' constant.
Perhaps you have imported this function from an older version of LabVIEW (7.x or earlier), in the upgrade process some functions are altered and this might be an edge case, try to create the file creation from scratch.
Without seeing any code it's hard to give advise.
Ton
10-15-2010 01:34 AM
I'm using Labview7.1 and i did make it from scratch. It was'nt taken from anywhere else.
Here's the pic of the vi
thanks
vaney
10-15-2010 01:52 AM
think i got it..
it's because of the write characters to file - boolean input to append to file(new file:F) is false!!
thanks for your help..
10-15-2010 01:54 AM - edited 10-15-2010 01:55 AM
Have you double checked you have a path connected to the Create file? If you do, it shouldn't ask, else it does.
(Meh, read all thread before answering)
/Y
10-15-2010 02:20 AM
Setting the append flag to true might solve the problem, but it's not a nice solution. Your Open/Create/Replace file opens a file, so you should use file functions which work on an open file afterwards.
Or, even easier, just use the file dialog to browse to a file (instead of Open/Create/Replace file). The file dialog will return the selected path without opening the file.
10-15-2010 06:17 AM
that works!
thank you!
10-15-2010 06:27 AM
I'm glad it works. If you work with a file reference don't forget to close it once you're done.
Btw, you can mark a post as solution so others know the problem is solved.