DataAcqusitionToolbox write has a delay

조회 수: 5 (최근 30일)
Kevin
Kevin 2023년 6월 14일
댓글: Kevin 2023년 6월 15일
I am using a NI DAQ. I have code that follows this skeleton code:
dq = daq(...)
dq.addinput(...)
dq.addoutput(...)
dq.start();
tic
dq.write(some_output)
toc
The issue is that in this timer, MATLAB consistently takes ~ 0.7s longer than expected. For example, if my daq is running at a rate of 1000Hz, and my output is 3000 samples, total time to run would be ~3.7s, rather than an expected 3s.
Digging into the profiler, this seems to be due to just the delay required to start up the hardware for the daq or something related, but I would like to minimize or eliminate this delay. Any ideas?
  댓글 수: 2
Mario Malic
Mario Malic 2023년 6월 14일
"If the DataAcquisition has both input and output channels, the input acquisition begins and ends at the same time as the output generation, resulting in the same number of scans."
Maybe your output signal is longer?
Kevin
Kevin 2023년 6월 15일
I've confirmed that my output signal should be the exact expected amount of time.

댓글을 달려면 로그인하십시오.

답변 (1개)

Mario Malic
Mario Malic 2023년 6월 14일

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by