Trouble Shooting Analog Input and Output using Simulink

4 views (last 30 days)
We have an analog input from NI USB 6008 DAQ that is functioning properly as a stand-alone system in matlab simulink. In this case, we can run the simulink model, turn our encoder shaft, and receive reasonable and consistent results. However, when we add analog output to the model, for some reason the analog input data becomes skewed. Does anyone know a possible reason for this?? Your help will be greatly appreciated.
  2 Comments
Kaustubha Govind
Kaustubha Govind on 14 Mar 2011
What solver are you using? You could compare the time-steps taken by the solver (often logged as 'tout') with and without your analog output to see if that's what causing the skew.
Shankar Subramanian
Shankar Subramanian on 23 Mar 2011
Hi,
What mode are you running the Analog Input block in the model - Is it Synchronous or Asynchronous? This is an option that exists at the top of the Analog Input block mask. The synchronous mode blocks and returns new data every time step where as asynchronous mode buffers and returns all of them (FIFO manner). You can read about the different modes here:
http://www.mathworks.com/help/toolbox/daq/analog_input.html
Also, what is the sample time that you have set for AI block in comparison to the source that is driving your AO block? Are you trying some kind of a control algorithm in your model?
Thanks,
Shankar

Sign in to comment.

Answers (0)

Categories

Find more on Data Acquisition Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!