LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform timestamp

Solved!
Go to solution

I am using DAQmx and I am using the read function with the 1D waveform polymorphic instance. I am simply reading 10 channels of analog voltage data, but the reason I'm using waveform is becuase I need timestamp data for each sample collected. I also need multiple samples, which is why I'm not using single sample polymorhpic instance.

 

WIth the ten channels, I'm extracting the Y data and then concatenating all the values into one 2-d array where each channel column represents one channel of data. I'm trying to extract the timestamp from the waveform using (get waveform component t0), however, how do I get the timestamp into a form that can be concatenated with the other 1d data? When I convert it to double it just gives me one element and not an array of data. So theres only one timestamp for every like 100 lines of voltage data. 

 

Please see below code. hh000000.gif

0 Kudos
Message 1 of 8
(4,745 Views)

You could consider converting it to a string. Then you have the whole timestamp in one cell. Or use seconds since 1904 or something, but that will be an enormous number.

0 Kudos
Message 2 of 8
(4,736 Views)
Solution
Accepted by topic author Snow_In_Tehran
What's the point of converting to a 2D dbl? You can use Export Waveforms to Spreadsheet File and the math operations will work with waveforms. And please, use a single Index Array function. It's expandable by simply dragging the bottom down.
Message 3 of 8
(4,734 Views)

Thanks Dennis! I will use this approach. 

0 Kudos
Message 4 of 8
(4,706 Views)

Ultimatley, I would like to just use waveform exclusively and write all the channels with timestamp to my spreadsheet file, however, since I need to perform some scalar operations on some of the channels, I converted them into Y-component doubles. 

0 Kudos
Message 5 of 8
(4,702 Views)

Hi Dennis, I see what you're saying with using the math operations on the waveforms themselves. However, as you can see below I'm trying to add the single waveform arrays into one 2D array then write to waveform spreadsheet file, where each column represents each DAQ channel. Do you know how I can accomplish this?aaaa.gif

0 Kudos
Message 6 of 8
(4,698 Views)

Now that you have a single Index Array, good.  But you don't need all of those index constants.  Delete them all.  By default it will give you 0, 1, 2, .....

0 Kudos
Message 7 of 8
(4,687 Views)
Don't use the regular Write to Spreadsheet File. Use the one for waveforms like I already said.
0 Kudos
Message 8 of 8
(4,682 Views)