Analog Input/Output Single Sample blocks in Simulink

2 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Aabha
Aabha il 14 Feb 2025
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 Commento
Anna
Anna il 19 Feb 2025
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!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Data Acquisition Toolbox Supported Hardware in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by