Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to increase the buffersize of a ni-USB 6212

hi

i am using labview 8.6 with DAQ device ni-USB 6212. i am aquiring a Analog squarepulse of 0.5 Hz continuasly. i am having a problem with buffer overflow,  it is skiping one complete periode every after 12 cycles. can any body have some idea how i gonna fix this problem how to increase the buffer size? or is there any other solution?, bye the way i am using DAQ assitance express vi in labview to aquire the waveform.

 

thanks 

 

 

0 Kudos
Message 1 of 11
(5,681 Views)

Hi,

 

Thanks for your post and I hope your well today.

 

The 6212 has a sample rate of 400 kS/s multichannel (aggregate). This means if you use 1 channel you get 400, 2 channels 200 etc.

 

Your overflow will because your machine can't keep up with the device... this depends on how your configuring your acquistion in your code. The important factors for a continous acquisition is the Sample Rate (rate you acquire samples) and Number of Samples per Channel (to set the buffer size). 

 

For example lets say you have one channel and you wish to sample at the maximum rate - 400kHz. 

 

Rule of thumb states that if you have a sample rate of X then the number of samples (buffer size)  of about 10%, so 40kSamples. This means in your DAQmx code, you need to read from the buffer 10 times a second (loop rate of 10ms) otherwise you will run out of space in the memory and lose rate (buffer overflow).

 

The maths,

40kSamples x 10 Reads per second = 400kSamples per Second

 

Thus it is important that your acquisition loop can iterate once every 10ms, therefore if you are performaning any anylsis you should consider using the producer/consumer design pattern - for now, though, lets see if we can stop this error). If you think it could be the loop rate, then maybe disable the code for the time being.

 

Hope this helps, please let me know your thoughts. 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 11
(5,678 Views)

hi 

 

thanks for the reply and suggestions,  

but the problem is that if i set the loop itration to 10ms then for rest of the analysis  i need to run the loop more slower. this makes me a bit confuse, i am posting you my vi can u plz have a look on this. may be then u will get better idea of error i am facing. the code is really messy but hope u will understand. 

thanks,

 

Best Regards

 

 

0 Kudos
Message 3 of 11
(5,645 Views)

Hi Malik,

 

Good Morning and I hope your well today.

 

Could you please attach your code, then I'd be more than happy to take a look.

 

Thanks, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 4 of 11
(5,599 Views)

Hi Hillman 

the vi is attached now , let me explain the situation a bit more, what i am doing in this vi is generating a digital pulse and then aquiring that pulse back on Analog input channel of DAQ 6212, the other signal is from a pressure sensor, i am measuring a rough time delay between both signals and then writing it into an spreadsheet, but the problem as i said that it skips one cycle during the acquisition.

the number of samples i setted to 1k and i run that test for 20 minutes or some time more

the setting for digital pulse is:

High time is 500ms or 1000ms

Low time is 500ms or 1000ms 

 

the results in excel are also attached with  the vi

 

thanks

0 Kudos
Message 5 of 11
(5,596 Views)

Hi Malik,

 

Thanks for your rapid reply and I hope your well.

 

I am afraid I was a little confused by your code.

 

Here is some example -  please let me know how it finds you, LabVIEW 8.6.

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 6 of 11
(5,542 Views)

hi hillman

 

thanks to you for such fast replies to my problem, i think this vi makes you confuse of some missing details, what i am doing in this vi is that i am generating a digital pulse that is going to trigger a valve for opening and closing action. i also acqaure that pulse as analog input to one of analog input channels of ni USB 6212,

in response to this trigger the valve open or close which correspond to the increase or decrease of pressure  inside the valve, and to measure that i place a pressure sensor inside and the out of the pressure sensor is also acquired via 6212, inside the vi i am compairing the time delay of both signals on rising and falling edge. now the problem is with the acquisition of this digital pulse. when i setup the parameters as i mentioned in my early post, it skipes few cycles during the acquisition in result it produces Zeros(0) can be seen in Attached Excel file.

 Is there any way that i can talk to you to explain my situation more to you thanks

hope u understand now

 

best Regards

Malik

0 Kudos
Message 7 of 11
(5,539 Views)

i have checked the example u sent me, it is not matching with my problem,

please i have a look on the reply above with more details.

thanks

 

looking to your kind suggestions

 

Best Regards

Malik 

0 Kudos
Message 8 of 11
(5,523 Views)
Hi James, I’m Sebastian from Argentina and I hope you can help me.
I’m train to acquiring an analog signal of 10 KHz for 5 seconds at 400 KHz sampling rate and write it to a .txt file, using an NI USB 6212 whit LabView 8.6. The signal is an RLC serial discharge, and me problem is the buffer. For what I see in the forum you now how do it. Me .vi is attaches.
Please if you have same idea or question let me now.
Thanks
Sebastian Lorandi 
sjelorandi@hotmail.com
0 Kudos
Message 9 of 11
(5,345 Views)

Hi Sebastian,

 

Good Morning and I hope your well today.

 

Thanks for the post. I would recommend posting a new forum for new issues - because its unlikely you'll require support if you post at the end of another users post. 

 

However, I have written some code for you, LabVIEW 8.6. I hope it finds you well.

 

I have a few suggstions for your code:

 

As you require a finite acquisition you do not require any loops. As explained in the code, you can setup the DAQmx Task to run for 5 seconds, acquiring at 400kHz.  The way to do this is to specify the number of samples you wish to acquire based on your sample rate. The expression is, Number of Samples / Sample Rate = Acquisition timei.e.  ? / 400k = 5, therefore you need to set your samples to read per channel to 2M Samples.

 

Please let me know how the code finds you, and I'd be happy to answer any questions you have. 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 10 of 11
(5,337 Views)