From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data in Multiple files

Hello All,

I am trying to save data in multiple Excel sheets.

I mean here is the steps.

Creation of multiple files does not work:

o   Start program

o   Choose Filename

o   Press File Control Switch

o   -> write some data

o   Stop File Control Switch

o   Change Filename

o   Press File Control Switch

o   -> Now the second file is not created so no data is stored

 

I am attaching my VI. Please have a look

 

If some body have an idea or solution then please let me know.

 

Thanks

Siddharth

0 Kudos
Message 1 of 3
(2,811 Views)

Why do you use the word "Excel"?  The term "Excel Files" should be reserved for files with the extension .xls and .xlsx that use the (proprietary) Microsoft Office Excel format.

 

Bob Schor

0 Kudos
Message 2 of 3
(2,761 Views)

When LabVIEW opens a file for writing, it generates a reference number that it uses internally to identify the file it has opened.  That number is being circulated around the shift registers in your while loop. After your VI starts, there is no way to change the reference number for the file you want to write. LabVIEW will continue to write values to the file selected when the VI is run while the Boolean is true and will not write values while the boolean is false.  In this sense, you can think of it as a 'pause logging' button.

 

I would be tempted to create an Event Structure, and add a new button to create a new file. This event would close the old file, and then prompt the user for a new file.  You could use the existing code to handle the stop case, or move closing the file open when the stop button is pressed to another Event Structure case for the stop button value change.

 

Cheers!

0 Kudos
Message 3 of 3
(2,758 Views)