05-12-2015 08:08 AM
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.
Solved! Go to Solution.
05-12-2015 08:18 AM
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.
05-12-2015 08:19 AM
05-12-2015 10:33 AM
Thanks Dennis! I will use this approach.
05-12-2015 10:51 AM
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.
05-12-2015 11:27 AM
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?
05-12-2015 11:31 AM
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, .....
05-12-2015 11:35 AM