05-29-2017 12:49 PM
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
05-29-2017 06:26 PM
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
05-29-2017 07:35 PM
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!