LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open/create/replace file "open or create" "create or replace"

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

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

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

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 8
(3,534 Views)

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

 

lvquestion.JPG

thanks 

vaney

0 Kudos
Message 3 of 8
(3,530 Views)

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..

 

0 Kudos
Message 4 of 8
(3,522 Views)

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

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

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

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.

 

0 Kudos
Message 6 of 8
(3,508 Views)

that works!

thank you!

 

0 Kudos
Message 7 of 8
(3,496 Views)

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.

 

0 Kudos
Message 8 of 8
(3,486 Views)