LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 200279 and slow program running

Solved!
Go to solution

I've read quite a few posts on this error but still can't fix mine. While running the programme and performing measurements the error 200279 suddenly turns up. In addition, the programme is really slow; I'm trying to read some data from a QD and a PSD (two different position detectors) and when I move a detector (QD or PSD, it doesn't mind) the answer of the programme is too slow. I tried to fix the error setting the time out value to -1, but the error is still there. What can I do?

 

Thanks in advance,

 

Guantes

 

P.D.: Error 200279: 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.

0 Kudos
Message 1 of 3
(2,610 Views)
Solution
Accepted by topic author jorge.gomez

You need to figure out why your VI is running so slow.  Does it start out faster then slow down over time?

 

I see many things that could be causing slowdowns.

 

1.  Lots of Express VI's.  Express VI's are intended for ease of setup and quickly getting code started.  They aren't known for efficiency.  FIX:  Use regular LabVIEW functions instead such as DAQmx and file writing.

2.  You are writing to a file within the loop.  File writing is typically slower than other functions.  Maybe your hard drive is slowing you down.  FIX:  Use producer/consumer and transfer the file writing to another indepdendent loop.

3.  You are building XY graphs in the loop.  Inside that express VI, it is continually appending more data into arrays stored in shift registers.  As those arrays grow, windows needs to hunt down more contiguous memory to store the data.  Eventually it would run out of memory.  How big are those graphs getting?  FIX:  Occasionally clear out those graphs.  (EDIT:  I see that you have the "Clear Data on Each Call setting turned on for that.  This might not be a problem.)

4.  You are writing to property nodes every loop iteration.  Changing properties of controls can be quite slow at times.  FIX:  Only write to a property node in the event the properties are actually changing.  The writing of True to the Plot Visibility properties is really bad because you are doing it every iteration it never changes.  You might as well just move that outside the loop.

 

Benchmark your code to see how long each loop iteration is actually taking.  Disable parts to see if you can speed it up.

0 Kudos
Message 2 of 3
(2,600 Views)

Thank you very much for your reply. I've fixed the code  😃

0 Kudos
Message 3 of 3
(2,543 Views)