01-07-2010 01:34 AM
Hi,
I am using USB6218 DAQ device and Labview 9. I have used DAQ assitant in my VI and my setting are RSE mode to sample 30 channels, continuous mode,20 samples,rate 100hz. This is what I had in mind from my programming background from C/C++ and I am new in using Labview. I was trying to get 20 samples from channel 1 in 10ms period and store in an array for eg channel_1_val[20] and switch to channel 2 and get 20 samples in 10ms time and store in channel_2_val[2] and so on for thirty channels. I figured timing should not be an issue as USB device has 250Ks/S for 32 channel which would approx 7ks/S for channel which is 120us roughly. So 20 samples in 10msec is plenty of time. Does the setting in DAQ assistant would do my above task as expected. Need help from experts.
Thanks
01-07-2010 02:13 AM
No, DAQmx does not exactly do what you want.
If you want to acquire 20 samples from 30 channels it takes the first sample from all the channels, then the second from all the channels and so on.
Please see Data Acquisition Sampling Terminology.
DAQmx returns something like:
Ch0/sample0, Ch1/sample0, Ch2/sample0, Ch3/sample0, Ch4/sample0, ........... Ch0/sample1, Ch1/sample1, Ch2/sample1,.........
Christian
01-07-2010 11:24 AM
Hi Christian,
Just curious to know what I think is gonna happen to my attached VI. Please correct me if I am wrong. I am expecting, channel 1 sample 1 and a msec later channel 2 sample 1 and a msec later channel 3 sample 1 and so forth. And when all my 20 samples for 30 channels are acquired which would take roughly 600msec the while loop will wait for 500msec to start the next sampling. This is what I had in mind when I created the VI. I am also curious to know is there any buffer allocated or it just takes a sample from channel 1 writes in a register or memory and after a msec takes a sample from channel 2 and overwrites on the same register or memory. The reason I am asking that is I would like to write all my samples on an excel in a format given below and fill an array with 20 samples from each channel and take an average to determine the pressure leak
Timestamp | channel no | Voltage(v) | Pressure(psi)
and may be plot a graph based on how fast I get this done. Currently write to spreadsheet on my Vi is filled with rows equal to no of samples and just one column. I am guessing that I need a build an array with the value that I sample everytime after a msec and finaly write this array to excel. If that is the case how will I form the dynamic array. Thanks for your support.
01-07-2010 03:25 PM
No. Each msec you will sample 30 channels and since you request 20 samples, you will get data after 20msec.
Your conversion from dynamic data is also all wrong. You would want to convert to a 2D array. As it is now, you are throwing away most of your data.
01-07-2010 09:19 PM
01-07-2010 10:03 PM