LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unable to achieve mentioned sample rate (NI-USB-6009)

Hi,

I have labview2010 and Ni-USB-6009. i am trying to write data coming through Ni-USB009 on a text file.

everything is Ok except the sampling rate. i set rate to 10K but when i check on text file it only gives me 50 to 60 readings per second but it should be 10K/second.any idea how to improve that? code is attached

0 Kudos
Message 1 of 6
(2,311 Views)

I do not have NI-DAQ on my machine. But you do now that for your DAQ card the sample rate is aggregate. That is the same as  all the channels must share the sample rate. So for 1 channel you can have max 10 KHz sample rate for 2 channels 5 KHz, and so on



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 6
(2,292 Views)

yes i know that. NI-USB-6009 has 48KS/s and i am taking 10K for each channel and i am using 3 channels. but still when i saw the ouput text file it only gives be 60 values per second. am i making any mistake?

0 Kudos
Message 3 of 6
(2,290 Views)

I see the mistake now. Your loop is spinning as fast as it can and that is about 60 times pr second. And every time you read your DAQ unit. You read all samples that are in buffer. But you take a single value from this group and store it. Labview running in Windows/Mac/Linux is not a realtime system. So you can not read one sample each time at 10 KHz speed. But you can read a group of samples say with a rate of 10 Hz. In your case that will 1000 samples pr channel each time. Also check out these functions. You should also know that the Get Time/Date string function use the system clock. And that is only updated with limited speed around 50 Hz I think.

 

Array To Spreadsheet String Function
Owning Palette: String Functions
Converts an array of any dimension to a table in string form, containing tabs separating column elements, a platform-dependent EOL character separating rows, and, for arrays of three or more dimensions, headers separating pages.

 

 

Spreadsheet String To Array Function
Owning Palette: String Functions
Converts the spreadsheet string to an array of the dimension and representation of array type. This function works for arrays of strings and arrays of numbers.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 6
(2,279 Views)

so you mean i can set my sampling rate to 10 Hz and then read 1000 samples each time?

thanks for the suggestion to use "Array To Spreadsheet String Function ".

 

0 Kudos
Message 5 of 6
(2,274 Views)

@Hussain01 wrote:

so you mean i can set my sampling rate to 10 Hz and then read 1000 samples each time?

thanks for the suggestion to use "Array To Spreadsheet String Function ".

 


No not quite. Take a look at this example note the sample rate, and samples to read controll functions



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 6
(2,265 Views)