Is it possible to use NI DAQ 6211(USB) and matlab without latency? Or how to make latency always the same?

2 visualizaciones (últimos 30 días)
The idea is to use NI USB DAQ 6211 with Simulink in real time. The delay between input and output is variable and depends on the frequency of the input signal. Is it possible to limit the delay to a constant and small value? Every idea is welcome.
  1 comentario
Bilgehan paray
Bilgehan paray el 9 de Mzo. de 2015
Hi; Can you elaborate more what you intend to do please?
I think there is about 3ms latency when using Matlab. If you use C, it was about 700us. (calling outputSingleScan function).

Iniciar sesión para comentar.

Respuestas (1)

Lucien Robinault
Lucien Robinault el 7 de Feb. de 2018
Editada: Walter Roberson el 7 de Feb. de 2018
Hello,
You can use the event, DataAvailable, putting a listener whom will call one function to manage input then call another one for ouput.
Changing the default values from the parameter NotifyWhenDataAvailableExceeds, and NotifyWhenDataAvailableExceedsAuto, to really small value while increasing the acquisition frequency should give you a decent result.
The following exemple is a really good sum up. And to get a pretty reactive output as Bilgehan paray said you can just use outputSingleScan from a different session from the one you use for input.
  1 comentario
Walter Roberson
Walter Roberson el 7 de Feb. de 2018
This does not appear to be relevant. This solution is for use with MATLAB, not for use with Simulink Real-time, which requires everything to be coded in Simulink blocks. I have not cross-checked the references but I would be surprised if these functions from DAQ toolbox are available in MATLAB Function Block.
The answer to the question for the MATLAB level is No, MATLAB itself operates as a process on host operating systems that do not offer hard real time guarantees. Simulink Real-time on the other hand is run by a real time kernel on a dedicated system and so has more opportunities to provide hard real time guarantees.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by