LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write To Spreadsheet File

Hi guys

 

I have a little program using a DAQ to receive some votalge signals, I have some requirements to do a database

 

The requirtements are:

 

1.- Save the signals every five seconds

2.- Create a file every day

3.- Create the next file automatically

4.- Open the database with excel

 

I can do this very well with the block "Write to measurement file". The problem is that I would to open this database in other one computer, I can´t, I have to install a complement for labview

 

My question is if I can do the job done for this block (Write to measurement) whit the block "Write to spreadsheet file" and save the databse direct to excel

 

Thank you

 

 

0 Kudos
Message 1 of 17
(5,431 Views)

Yes.

 

Write to Spreadsheet File.vi creates a tab-dlimited text file which can be opened and read by Excel. It does not create a native Excel file format.

 

Lynn

0 Kudos
Message 2 of 17
(5,429 Views)

And I can create a column with the name of the signals?
Jus like the picture

0 Kudos
Message 3 of 17
(5,415 Views)

You can write the tab delimited header row whenever you create a new spreasheet file, then append the data.


@Bechard wrote:

And I can create a column with the name of the signals?
Jus like the picture


This code seems incredibly convoluted!!!

0 Kudos
Message 4 of 17
(5,408 Views)

And How can I do that?

0 Kudos
Message 5 of 17
(5,397 Views)

Something like this would do the trick:

 

NI Community Example: Add a Simple Header to a Spreadsheet

https://decibel.ni.com/content/docs/DOC-3817

 

A little bit of searching for terms like "spreadsheed", "header", "append", etc. on NI.com will go a long way- similar questions and problems have come up countless times before in the forums and there are numerous examples related to what you need to do.

 

Regards,

Tom L.
0 Kudos
Message 6 of 17
(5,388 Views)

Write a text string to the filename you are going to save the data in, using Write to Text File function, with each "column header" text seperated with the using the delimiter that is used with the Write to Spreadsheet file function, in other words if you are creating a CSV (comma seperated variable) file, use commas, if tab delimited, tabs, then end the line with a CR/LF pair. Then on the Write to Spreadsheet file function, select append,, which should then put the correct values in the correct columns.

 

 

<typed too slow!>  Outlaw's suggestion would be simpler.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 7 of 17
(5,385 Views)
And How can I do to create a database daily automatically?

 

0 Kudos
Message 8 of 17
(5,370 Views)

It isn't going to be a "database" just a text file of formatted data.  As to creating a new one each day, there are time and date functions in LabVIEW. When the program is started it can save the date/time in a shift register (or several other techniques) and before each write to the data file it can be compared with the current date/time, if it is the next day, or 24 hours later, or whatever criteria you decide is to be used, then it opens a new file, writing the header information, then saving the data, while updating the saved data/time to compare for the next 24 hours. You will also want to have some file naming scheme to create a new filename for each day, frequently some form of the date

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 9 of 17
(5,367 Views)

Damn, this is so complicated XD

0 Kudos
Message 10 of 17
(5,347 Views)