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: 

Datalogger to excel for NI 9213

Solved!
Go to solution
I'm interested in an application that will stream all the 16 thermocouples directly to an excel spreadsheet along with time the reading was taken. Example 1 reading per minute for 48hrs.
0 Kudos
Message 1 of 18
(3,238 Views)
What have you coded so far?  Did you look at the examples for acquiring thermocouple data with DAQmx?
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 2 of 18
(3,231 Views)

I attached what I have so far utilizing the 9211 and 9239 cards in a compaq daq - the columns aren't seperated after running the vi in the excel spreadsheet.

I need to actually stream16 thermocouples to a spreadsheet along with the time the samples were taken in seperate columns.

0 Kudos
Message 3 of 18
(3,206 Views)

I'm still stuck with LV 8.5.1 so I can't open that file (you can save for previous and repost it).

 

If you're not getting the right columns in your spreadsheet you're probably using the wrong delimiter.  The file write VIs default to a tab, you want to use a comma when writing to an Excel spreadsheet.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 4 of 18
(3,202 Views)
I hope I saved it properly - take a look - I believe commas were used... 
0 Kudos
Message 5 of 18
(3,197 Views)

Excel is showing the data in separate columns so you must have specified the wrong delimiter when you imported the file. How exactly did you do that? What kind of extension did you give the file?

 

If you want date/time, then you will have add that information. You are currently removing all timing information when you convert from dynamic data to a 1D DBL array. You could use the Get Date/Time String and convert the data to string before using the Build Array.

 

p.s. Using the second build array to convert to a 2D DBL is just not necessary. Also, why are you acquiring so many samples at that rate and then throwing them all away? If you only want one sample, set the DAQ Assistant for that. If you want to acquire that many samples, at least do something with them like taking the mean.

0 Kudos
Message 6 of 18
(3,196 Views)

Oops, I had it backwards on the delimiters.  I never write to .xls files since Excel is limited to 65535 rows.  I always write to a .csv file first and then massage the data and present it in excel later.

 

You have to do two things:

1.  Change the  comma delimiter to a tab (or just remove it since that's the default).

2.  Replace the commas in your header string to tabs (i.e:   Pressure\tBonnet\tUpper\tMiddle\tLower   ).

 

Also, follow the advice of Dennis.  I would take a couple hundred points and take the mean for the final result.

 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 7 of 18
(3,188 Views)
In case you don't know, you'll have to right-click the header string constant and select 'Codes Display' before you put in your tab escape characters (\t).  If you switch back to 'Normal Display' you won't see them but they'll still do their job.  This is important to know because sometimes you can be fooled by a string that appears correct but causes strange behavior.  Switching to Codes Display often reveals that there are hidden escape characters that you didn't know were there.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 8 of 18
(3,183 Views)
I did what was asked but - I named the file "run1.xls" - the columns are now seperated but the data is not.
0 Kudos
Message 9 of 18
(3,162 Views)

You first have to realize that the Write to Spreadsheet file does NOT create an Excel file. You are creating a text file with a .xls extension and Excel is trying to import that and convert. Look at the file with Notepad and see what is actually being used as a delimiter. My guess is that you have improperly specified the delimiter with the Array to Spreadsheet String. You do not have to wire anything to this as the default is a tab.

 

Post the modifed VI and/or the text file.

0 Kudos
Message 10 of 18
(3,154 Views)