LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop time slowing down?

Solved!
Go to solution

Greetings,

I am getting the common Labview error where it states -

 

"The application is not able to keep up with the hardware acquisition.  Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all samples available may fix the problem"

 

I've tried all of the above to include setting the recommended samples to read to 1/10th the sampling rate, but still eventually the application crashes for the aforementioned error.  I can delay the inevitable error, but can't seem to prevent it completely.  I put in some timing code that I copied from a NI help to determine the duration of my While Loop as that time is a factor on how frequently I'm reading data from the hardware.  The While Loop duration is slowly creeping up for some reason, which in turn is decreasing the read rate.  Perhaps the reason why the loop duration is creeping up is obvious?  Is it still something to do with how the timing and read VI's are configured, or is it something in my code slowing down the loop??  For starters, I'd like to just run the application at 1000Hz sampling rate.  I require this application to run continuously for an indefinite duration of time.  I'm obviously not a polished LabVIEW programmer, so be nice please.  Thank you.

0 Kudos
Message 1 of 3
(3,134 Views)
Solution
Accepted by topic author busarider29

I figured it out.  Appears it was something simple and silly, like usual.  In the upper left corner of my While Loop, I'm creating DI channels with each iteration of the loop.  After I put that outside the loop, everything appears to be working fine now with the loop time not creeping and my read rate staying at a stead rate.  Cheers.

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

Your code was missing that subVI, so we couldn't see what was going on int.

 

I'm glad you found it.

0 Kudos
Message 3 of 3
(3,065 Views)