Closed Optikan closed 4 months ago
First, a question: What device are you using?
Regardless of the answer to that question, your application results in settings that are problematic. This code:
# Parameters
f = 30000 # Frequency of the sinusoid (30 kHz)
nb_cycle = 9
nb_samble_per_cycle = 3
number_of_samples_per_channel = nb_cycle*nb_samble_per_cycle
sample_rate = f*nb_samble_per_cycle # Sampling frequency (60 kHz)
Is resulting in these settings:
That results in ~3333 reads per second. The software overhead of a read call (our driver, Python, and any code you have) is causing your application to not keep up. I see you have some timing code. How many reads per second are you getting? Therefore, the read is not keeping up with the data throughput, causing the data to back up in the driver's buffer. When that is full it backs up into the device's FIFO. This topic on Continuous Acquisition and Generation with Finite Buffer Size has some details on how this all works.
A good rule of thumb is to read about 10 times a second. Even 100 is probably fine, but things like this can be system dependent. You'll need to characterize that.
Also, this isn't a Python-binding specific issue. Closing, and I hope this helps!
Hi I have a trigger that generates a sin wave of 9 periods every 3kz. I want to get at least 3 points per period for 9 periods and this for 18 channels. For this example I will try to get only 2 channels. Because the sin I generate has a frequency of 30khz i need to use a sample rate of 90khz to get 3 points per period and read 27 samples to have 9 periods.
My goal is to continuously read the data, calculate the fft and then plot it in real time. But if i just read my program wont bug, but as soon as add more operations after around 1Milion samples acquisition i get this error. I don't understand why and how to fix it. I try to use thread to make the operations outside the main function but still.
I have looked up the documentation and searched for answers but i am stuck with this error of " Onboard device memory overflow. "
Here is my code :
The error :