Analog Input/Output Single Sample blocks in Simulink

2 次查看(过去 30 天)
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