Discussion:
multichannel data on "Write to spread sheet"
(too old to reply)
zaidi
2008-07-21 17:10:10 UTC
Permalink
I need to sample data from four analog input channels. I am using NI USB 6229. It is very simple application (what i think). The sample rate is 40k for 2 seconds. I am using "Write to spread sheet" to write data to file. The vi runs fine when i use only one channel. It writes array of 80k data points in the txt file. Problem:When I use multiple channels, it only returns the last samples. for example if I use four channels, it returns four it gives four values instead of expected four arrays one for each channel.
MikeS81
2008-07-21 17:40:11 UTC
Permalink
Hi zaidi, which function do you use to get the data? Where do you have problems? In the subject you write "Write to spread sheet" but in your description it sounds like you have problems to get the data from the hw for four channels. To get the data you want you can use the DAQmx Read.vi and configure it to get a waveform for each channel. Multiple Channels -> Multiple Samples -> 1D Waveform.Hope it helps.Mike
zaidi
2008-07-21 21:10:08 UTC
Permalink
Thank  you for your help. I am using DAQ Assitant for data sampling. I have configured four channels in it. Each channel works fine individually. I have also attached graph with the Daq assitant. When I sample one channel the graph shows me  on plot and when i sample four channels it shows four plots. Which idicates that the data is sampled correctly. From the daq assistant the data is wired to "Write to spread sheet file.vi". It generates as txt file. When i sample single channel, at 40k for 2 sec, 80k sample points are generated but when i sample multiple channels only four sample points are generated one for each channel.I want to have 4-by-80k data matrix. Is it possible.Sajjad Zaidi
MikeS81
2008-07-22 05:10:06 UTC
Permalink
Hi zaidi, if i use the attached example code, then i get 4 channel with all values. How do you get and write your data?Mike


Unbenannt1.PNG:
Loading Image...
RT4CY
2008-07-22 16:10:13 UTC
Permalink
I understand you are using the DAQ Assistant and are trying to save to file using the Write to Spreadsheet function.  Make sure to wire the data into the 2D data input of the Write to Spreadsheet function.  Bring up the Context Help by pressing ctrl + H to see all of the inputs and outputs of the function.  See the attached image.  I have wired the data output from the DAQ Assistant to the 2D data input of the Write to Spreadsheet function.  Additionally, I have created a constant on the transpose? input of the Write to Spreadsheet function and set it to True.  When I run this VI, I simply create "test.txt" on my desktop and open it with Excel.  I have configured the DAQ Assistant to acquire from 4 channels, and I can see all of my data in the Excel spreadsheet.  Please post back if you have any further issues.Message Edited by RT4CY on 07-22-2008 11:04 AM


write_to_spreadsheet1.jpg:
Loading Image...
Loading...