LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong Time Displayed in Excel when "Export Waveforms to Spreadsheet File.vi" is used

I am using a DAQmx to collect thermocouple data from multiple ports. This data is being exported to excel with an Export Waveforms to Spreadsheet File.vi. I know my collection process is correct by the table I have on my front panel. The issue is the time column in Excel is displaying times in one second increments even if the data had been collected at a different rate. For example, the times displayed are always 0,1,2,3,..., while they should be, say 0,5,10,15,... How would I go about resolving this issue?

0 Kudos
Message 1 of 13
(3,185 Views)

You will need to provide additional information on your problem. How are you displaying the data on the Excel Data sheet. Are you using the standard date format:

    Excel (windows) are in days 1 for Jan 1, 1900

    Excel (Mac) are in days 1 for Jan 1, 1904

Are you inputting the time into the excel spread sheet with the correct date/time? You multiplied by 5?

Did you output the data in CVS format?

 

You have very little information to diagnose the problem. You do not even have a sample VI to display the issue or the data to work with.

0 Kudos
Message 2 of 13
(3,176 Views)
time Y[0] Y[1] Y[2] Y[3]
00:00.0 2.86E+01 2.94E+01 2.93E+01 2.83E+01
00:01.0 2.85E+01 2.95E+01 2.92E+01 2.84E+01
00:02.0 2.86E+01 2.95E+01 2.92E+01 2.85E+01
00:03.0 2.86E+01 2.95E+01 2.93E+01 2.85E+01
00:04.0 2.86E+01 2.95E+01 2.94E+01 2.84E+01
00:05.0 2.85E+01 2.95E+01 2.93E+01 2.85E+01
00:06.0 2.86E+01 2.95E+01 2.93E+01 2.84E+01
00:07.0 2.85E+01 2.95E+01 2.92E+01 2.84E+01
00:08.0 2.85E+01 2.95E+01 2.92E+01 2.84E+01

 

Above is what my data looks like in Excel 2003 for Windows. I am using the standard settings of the Export Waveforms to Spreadsheet File.vi. A time delay is being used within a while loop to control the rate at which data is being collected. The Export vi is outside of this loop. I have attached a copy of my vi. Please let me know if there is any more information you need to resolve this issue. Thanks.

 

 

 

 

 

 

 

0 Kudos
Message 3 of 13
(3,170 Views)
Does the representation for time change if you convert from Dynamic Data back to Waveform prior to using the Waveform to Spreadsheet File vi?
0 Kudos
Message 4 of 13
(3,167 Views)

It's very obvious why the data in the file is what it is. You are not getting a start time or dt in the first place because you are acquiring a simple 2D DBL array. Converting that to a waveform data type will not magically create that information. Simplest way to fix this is to aquire data as a waveform array in the first place.

 

You are also mistaken about some DAQ basics. Since you are using NSamp, the time between samples is not what you have wired to the time delay. What you have wired to the time delay is the time between scans. You don't have any DAQmx timing function in your code and I don't know what the time between samples is going to default to.

0 Kudos
Message 5 of 13
(3,162 Views)

The express VI (connect to Dynamic Data) you connected to the collector has the dt value set to 1. That should be changed to 5 if you want the correct value. I suggest you convert it to your own VI.

0 Kudos
Message 6 of 13
(3,157 Views)

Dennis,

 

I took your suggestion and acquired the data as a waveform array. This, however, displays the time at which the vi began to run in every row of the time column. This is obviously less favorable than counting up by 1 second, as it was doing before. I just want the time column to display the time at which each data point was taken. The table on my front panel does this just fine. How do I get the data in Excel to do the same? (An updated vi has been attached.)

0 Kudos
Message 7 of 13
(3,146 Views)

It does count up and show the dt but if you want to show only part of the timestamp, you will have to edit the function, try a different one (i.e. Write to Measurement File), or write your own with the lower level file i/o functions.

 

p.s. If you keep using the NSamp option with DAQmx Read, do it correctly and specify sample rate. If you only want a single sample, then change the DAQmx Read to 1Samp mode. Then you would have to wire the Seconds Between Samples to a Build Waveform function.

0 Kudos
Message 8 of 13
(3,139 Views)

How would I go about specifying a sample rate within my DAQmx Read?

0 Kudos
Message 9 of 13
(3,136 Views)

With the DAQmx Timing function. Look at how it's done in the DAQmx examples you have installed.

0 Kudos
Message 10 of 13
(3,133 Views)