LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Appending to file with Write File vi

Hi!

Have 2 questions:

1)
I am using the 'Open/Create/Replace File' vi in "open or create" mode and then 'Write File' vi.
How can I append data to the file if it is already existing?

Presently I am using shift registers to control the offset but was wondering if this could be avoided.

2)
If I use 'Write to Spreadsheet' vi how can error 43 be avoided if the user chooses to cancel writing but run the program?

I have attached a vi where I have used above mentioned cases.

I am using NI-DAQ 6.2 and LV-PDS 6.1

Thanks!

- Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 3
(2,676 Views)
1) Just set the position mode of the write function to "end".

2. Why do you get a dialog from the write to spreadhset VI? Normally that would happen if e.g. the append to file was set to false and the user or the application gave the path of an already existing file...If you want to avoid the replace or...dialog use a file dialog to ask the user for a path and use it's cancelled / exists outputs to control whether you run the write...OR make a copy of the spreadsheet write function and edit it so that you can control whether it should show an advisory dialog (don't know why NI did not include that, they did for the open/create/replace...)
Message 2 of 3
(2,676 Views)
Be sure to check the MODE of the file create vi. Wire a constant to it, and then select "open existing file"

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 3 of 3
(2,676 Views)