LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Erro -200279 and related issues

Hi everyone,
 
I'm hoping someone can help me. I'm still pretty new to this game so I could just be being dense but here's my problem.
 
I am designing a front-end for an experiment, it needs to encompass real-time control of a signal generator as well as managing data acquisition for the external system that the signal generator drives. I am presently using one analog output channel on an NI SCB68 board (via a PXI-6251 card in a PXI-1031 crate) and a few input channels, but will ultimately need mabe 10 input channels as well as a DMM (PXI-4071). I am currently sampling half a dozen input signals at something in the region of 500 Hz, and displaying these signals on graphs as a way of monitoring that they're working properly. I am also averageing every 500 samples and displaying them in a table (again to monitor the values are sensible) as well as writing them to a .lvm file.
 
I currently have all of this going on in a big while loop. It seems to work ok, but I occasionally get Error -200279:
 
Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:1
 
Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
 
Property: Relative To
Corresponding Value: Current Read Position
 
Property: Offset
Corresponding Value:
 
Take Name: _unnamedTask<48>  
 
 
 
I think this is caused by my loop timing. The loop executes an express vi which samples all my input channel: say 1000 samples at 500  Hz, so therefore the loop has to take 2 seconds to achieve this. Could it be that the extra tasks my loop has to execute cause the loop to take slightly longer than 2 seconds, so there is a time delay which grows with each execution of the loop. Eventually the delay grows to be larger than the loop time and so it's not finished processing loop "n"'s data when the signals from loop "n+1" start (because the signals are read continuously)?
 
It's possible that's just a load of rubbish and I don't know what I'm talking about - henc why I'm asking on here 🙂
If it helps matters any, I don't get the error if I remove the NI-DMM express VI from my code.
 
I don't expect for one second that my code is anywhere near optimal, so if anyone has any advice on the best way to organise this kind of thing I'd be very happy to hear it. Would multiple while loops be the answer? Or does this not really solve anything?
 
cheers
 
0 Kudos
Message 1 of 3
(2,697 Views)

Hi

 

For starters her is a bit more info on your error,

(DAQmx) Error -200279 During a Continuous, Buffered Acquisition

http://forums.ni.com/ni/board/message?board.id=170&message.id=177889

Secondly you could be right about your loop timings and getting a buffer overflow. In a loop every thing has to execute once before it runs again.

Express VIs are good but can be a bit slower then setting up the task with the DAQmx VIs

You say you are writing to file, how are you doing this? If you are opening writing and closing the file all within the loop it will do this every time the loop iterates, this can take quite a bit of time. What you might want to do is open the file out side the loop and close it when the loop has finished running this will give you a significant performance increase.

You say you are new to the game. Is there any specific areas where you would like some more information. I have added the kb link and a link for using DAQmx don’t for get there is a load of shipped examples that you can find in LabVIEW find examples (Help>>example finder).

Getting Started with NI-DAQ Software

http://digital.ni.com/public.nsf/websearch/DD52ABD7C15F0B15862562910074F09E?OpenDocument

KnowledgeBase

http://digital.ni.com/public.nsf/MainPage?OpenForm&node=133020_US

Regards

Tim

NI AE UK and Ireland

0 Kudos
Message 2 of 3
(2,669 Views)
Hi,

Thanks for the advice.
At the moment i'm doing nearly everything with express VIs, including writing to file which I've done basically by following the example code and pasting it into my own. So the answer to your question would be whatever way the express VI does things. Nearly everything I'm doing is inside my while loop, the only things that are outside are the tab controller for my front panel and a few property nodes to waveform charts so that I can clear their data history each time I restart the program (and hence blank the chart).

As I said, I doubt this is optimal. This is really only a "mark I" design, I'm sure I will go through dozens of iterations, but there is still a lot more I need to add to the program, and that will only serve to slow it down, so optimisation will be quite a big issue.

Thanks again
0 Kudos
Message 3 of 3
(2,664 Views)