LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to ignore DAQmx buffer errors ?

Hi,

In my application, I have to start the data acquisition of analog inputs (PCI 6025E)so that it could be read when the uses wishes to through a user interface VI. In addition to this, I also have a background thread that reads two of these AI ports every 250 msecs. However, by the time the buffer is read it has probably been overwritten atleast once and then it throws this error window saying buffer was overwritten etc. I think the buffer is a circular buffer and if so buffer being overwritten doesn't affect my application. So, is there a way I can avoid this error window from popping up ?

Thanks,
Sharmila
0 Kudos
Message 1 of 5
(2,836 Views)
I don't know about MX, but in Classic NI DAQ, the only way out of this is to create your background thread so that it doesn't happen.
Read the data from NIDAQ, even if you throw it away.

The driver ALWAYS considered it an error if it overwrote some data.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 5
(2,827 Views)
There might be a couple of ways out of this. If you create a functional global (also known as a LabVIEW2 style global)you can have it written too by your DAQ portion, and read from elsewhere. You can make this LV2 global act as a circular buffer, allowing you to read from it when ever you need to, but allowing the DAQ to write to it when ever it needs to. There has been a lot of discussion on the construction of LV2 globals, so you should be able to find the information.
Additionally, in the recent versions of LabVIEW there is an option (under the tools/option/block diagram menu pulldown) that allows enabling automatic error handling. What this does is cause an error dialog box to pop-up on any vi you use that has error handling that you haven't "handled" by wiring the error out to something else. Unchecking this may prevent the popup, I don't know whether the vi generating it will then just continue or whether it will need to have it or some earlier vi "reset". This is a useful feature, particularly in development and debugging, although I prefer to intentionally handle errors when I'm designing my code as it forces you to think about the various possible input cases that might fall outside of what you really wanted to happen.


Putnam Monroe
Certified LabVIEW Developer
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 3 of 5
(2,822 Views)
I believe if you set the DAQmx Read property Overwrite mode to "Overwrite Undread Samples" you will not get the error. The property can be found at DAQmx Read>>OverWriteMode

StuartG
0 Kudos
Message 4 of 5
(2,807 Views)
Thanks!
0 Kudos
Message 5 of 5
(2,793 Views)