03-11-2009 10:14 AM
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
03-11-2009 11:50 AM
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.
03-16-2009 03:52 AM
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
03-17-2009 03:40 AM
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,
03-17-2009 04:55 AM
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
03-17-2009 06:31 AM
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.
03-17-2009 07:18 AM
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
03-17-2009 07:50 AM
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
05-07-2009 08:02 PM
05-08-2009 03:53 AM
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.