Jump to content

DAQmx - Flush buffer


Recommended Posts

EDIT: This issue has been resolved using the solution mentioned in the question. Would be great if anyone could comment on whether or not this is a good way of solving this issue, or if there is a better way.

 

I am writing a program that collects samples from two channels from a DAQ Board. In total it reads up to 5000 times per pixel, and records images up to 150x150 pixels. This means I get a problem with the buffer size, in that I get the error -200279 saying I have attempted reading data that is no longer available. I've been trying to find a way to flush the buffer after each pixel. Is there an easy way to do this? Would for example clearing the DAQ task and opening a new one for each pixel work?

Edited by rasmusvt
Link to comment

Do you have some code you can share so we can see how you have your task setup?  In general, a buffer overflow is cause simply by not reading the data fast enough while in a continuous acquisition or by setting the buffer size (which will always be less than the default buffer size).

Link to comment

Like Crossrulz said, it's most likely that your buffer is just not big enough for the rate that your data is being acquired at. This KB outline the main techniques you could try to mitigate the error.

Why Do I Get Error -200279 from my DAQmx Read VI or Property Node?

http://digital.ni.com/public.nsf/allkb/AB7D4CA85967804586257380006F0E62

Normally, I like to use the AvailSampPerChan DAQmx Read property to see how much of my buffer is full, comparing it to the DAQmx Input Buffer VI (or property node). Most I the time, you can Read more frequently (decrease the "Number of Samples Per Channel" input of the DAQmx Read and that will prevent you from buffering up.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.