Analog Input/Output Single Sample blocks in Simulink

조회 수: 2 (최근 30일)
Anna
Anna 2025년 2월 12일
댓글: Anna 2025년 2월 19일
I am new with data acquisition anf I ned help to understand the difference between the Analog Input/Output blocks and Analog Input/Output (Single sample) blocks in Simulink.
I use a NI myDAQ device for data acquistion and use the blocks with equivalent configurations, i.e Sample time = 1/ sample rate and I choose Synchronous acquisition mode for the Analog Input block. I expected to obtain same results but I do not. What is the difference between the two blocks, i.e. with and without Single Sample?

채택된 답변

Aabha
Aabha 2025년 2월 14일
Hi @Anna,
There is a difference in the way in which the "Analog Input" and the "Analog Input (Single Sample)" blocks acquire and process data from the hardware device, which might lead to some discrepancies in their results, even while using the same sample rate.
The Analog Input block waits for a data sample to be available at each time step, in the synchronous mode. However, the Analog Input (Single Sample) block reads only one sample per execution cycle, which is directly queried from the hardware without relying on buffering. If the hardware has minor timing variations or jitters, it might not match exactly with the readings from the “Analog Input” block.
Since the Analog Input (Single Sample) block directly samples data from the device at each step, without accounting for buffering, it may introduce some timing deviations as compared to the ”Analog Input” block. These variations can become more noticeable at higher data acquisition rates or in cases where the device itself has internal processing delays.
You can refer to the following documentation of the blocks for more details:
I hope this is helpful to you.
  댓글 수: 1
Anna
Anna 2025년 2월 19일
Thanks a lot for the answer, it really helps me to understand. I have been working with these blocks keeping your explanations in mind and I start grasping the differences between the blocks.
Thanks!

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by