01-11-2022 11:47 AM
I am relatively new to LabVIEW and I am trying to save data to an excel file. The data is acquired from a sensor and the last data alone is taken for processing. The problem is I need to save only the current data in to an excel file with an ON/OFF switch. Further, for the next run if I ON the switch a new excel file has to be created and the data saving should stop if the Boolean is switched to off. I am unable to save the data into a new excel file instead it appends to the previous file. Also while saving, I am also not sure whether the data acquired is current data or it is the data in memory.
I am attaching the VI for your reference.
I have just modified the VI to save in excel using the 'write to measurement' block, the rest is provided by the vendor.
If someone can help it will be great!
01-11-2022 01:45 PM
Hi Pari,
@Pari_s wrote:
I am relatively new to LabVIEW and I am trying to save data to an excel file. The data is acquired from a sensor and the last data alone is taken for processing. The problem is I need to save only the current data in to an excel file with an ON/OFF switch. Further, for the next run if I ON the switch a new excel file has to be created and the data saving should stop if the Boolean is switched to off.
This reads like y good description of your task. You "just" need to create a VI to fulfill your requirements!
A common problem with "newbies" is the term "Excel file": which kind of file do you want to create? Is a simple spreadsheet file (aka delimited text file aka CSV file) good enough for you? Do you really need a proprietary file format only supported by MSExcel (like XLSX, XLSB, XLSM)?
Recommendation: stick with delimited spreadsheet files as LabVIEW comes with easy-to-use functions for them!
@Pari_s wrote:
I am unable to save the data into a new excel file instead it appends to the previous file. Also while saving, I am also not sure whether the data acquired is current data or it is the data in memory.
I am attaching the VI for your reference.
I have just modified the VI to save in excel using the 'write to measurement' block, the rest is provided by the vendor.
Unfortunately you forgot to attach your VI, so you need to debug on your own…
01-12-2022 08:41 AM
Hello,
Regarding your first question, any format csv or Tab limited text format is okay.
I think I attached my file this time correctly.
Thanks for answering my question
01-12-2022 01:42 PM
Hi Pari,
@Pari_s wrote:
Regarding your first question, any format csv or Tab limited text format is okay.
You forgot to attach all those missing subVIs and the project file. Next time you better ZIP the whole project folder…
You forgot to cleanup the block diagram! Your code is next to unreadable…
Please cleanup the whole VI and remove(improve atleast the items listed here…
01-13-2022 07:06 AM
Hello GerdW,
Thanks for answering.
I am attaching the original version of the files (clean version I suppose) directly from the Vendor.
The version ending with _demo is the raw file without any modification while the version ending with _Device_v1 is the one my ex-colleague created.
Please let me know if you need any other file or information.
Thanks