06-30-2011 09:38 AM
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?
06-30-2011 10:00 AM
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.
06-30-2011 10:41 AM
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.
06-30-2011 10:47 AM
06-30-2011 11:05 AM - edited 06-30-2011 11:09 AM
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.
06-30-2011 11:14 AM
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.
06-30-2011 12:53 PM
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.)
06-30-2011 01:26 PM
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.
06-30-2011 01:34 PM
How would I go about specifying a sample rate within my DAQmx Read?
06-30-2011 01:42 PM
With the DAQmx Timing function. Look at how it's done in the DAQmx examples you have installed.