Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do my loops slow down after many iterations

My Vi seems to freeze up or slow down after several iterations of the loop. This is an Analog Input Capture VI.
0 Kudos
Message 1 of 3
(2,790 Views)
First, you need to move the AI Config, AI Start, and AI Clear operations completely outside of the looping structure. Take a look at the Example VIs that ship with LabVIEW for Continuous Acquisition. I doubt you really want to confgure the hardware each time you loop. The time overhead associated with hardware access and configuration is significant.

Second, I notice that your sampling rate is 96ksamples per second, yet, you display the data in real-time. Given the refresh rates of most displays, you are essentially anchoring the acquisition loop to the 75Hz (or so) refresh rate of the monitor. You may want to try streaming the data to disk and posting graphical updates using a boolean "refresh control".

Just some ideas for you to consider.
0 Kudos
Message 2 of 3
(2,790 Views)
First of all, thank you for your contribution. You are right to say that I have no need in changing the AI Config every time that the loop runs. But as this is supposed to be a soft-scope, I need to be able to update the parameters associated with AI Start while the loop is running (e.g. trigger level).

I have tried to move the AI Config subVI out of both loops but the error as a result is: "No transfer in progress for the specified source."

I also need a sampling rate of exactly 96kHz. I realize that the laptop clock cannot attain this value. Do you know how I could get exactly 96kHz.
0 Kudos
Message 3 of 3
(2,790 Views)