error: certain number of scans to initiate background generation

12 visualizaciones (últimos 30 días)
Sofyan
Sofyan el 13 de Mzo. de 2024
Respondida: Vandit el 20 de Mzo. de 2024
I am acquiring and generating data simulatiously in continuous background sessions (two objects: one for aquisition and another for generation) using a NI PCI 6255 daq with sampling frequency of 30KHz as in the following steps:
1- acquire data contiously for one second.
2- calculate the FFT and check if any frequency between 8 to 11Hz is higher than a baseline.
3- use this frequency to generate a signal with length (1/ detected freq).
My main problem is getting error during the singal generation although I tried both preload and write functions:
using the preload function I got: Preload at least 14993 scans to initiate background generation.
using the write function I got: Write at least 14993 scans to initiate background generation.
This means I can generate minimum about 0.5s data which is too long for my approch.
If any one can help, is there any way to generate such short signal?
Highly appreciate you support in advance..

Respuestas (1)

Vandit
Vandit el 20 de Mzo. de 2024
Hi Sofyan,
The error you are encountering during signal generation is due to the buffer size requirement of the NI PCI 6255 daq. The error message suggests that you need to preload or write a minimum number of scans before initiating background generation.
To resolve this error and generate a shorter signal, you can adjust the buffer size and the number of scans to write. Addressing the challenge you are encountering with generating short signals using your NI PCI 6255 DAQ device, here are a few strategies you might find helpful:
  1. You can decrease the buffer size used for signal generation. This will allow you to generate a shorter signal.
  2. Instead of writing a large number of scans, you can write a smaller number of scans to generate a shorter signal. This can be done by calculating the number of scans based on the desired signal length and the sampling frequency.
  3. Consider generating your signal in smaller segments. You can create short bursts of the signal at the desired frequency and then concatenate these segments together. This method allows for the production of shorter signals while still capturing the desired frequency.
  4. Lowering the sampling rate would decrease the number of scans needed for a given duration, but this might not be feasible depending on your application's requirements.
  5. If your DAQ device and setup support it, you might configure the signal generation to start based on an external trigger. This way, you could preload a longer signal but only trigger the generation when needed, based on your FFT analysis results.
For more information on how to generate continuous and background signals using NI devices, please refer to the following documentation:
Hope this helps.

Categorías

Más información sobre Simultaneous and Synchronized Operations en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by