Filtering in real time from a NI DAQ

조회 수: 12 (최근 30일)
Marco Tito Scordo
Marco Tito Scordo 2017년 1월 18일
댓글: Walter Roberson 2017년 2월 7일
Hello Guys, I'm trying to acquire an analog signal (coming from a sensor) from a NI DAQ board and I would like to manage better the plot and filtering in real time in Matlab. I'm acquiring in background operation. What is hard is how to have access to the data (from the listener) for processsing: I'm able to plot only one second of data. Does someone knows how to solve this? Thank you

채택된 답변

Vandana Ravichandran
Vandana Ravichandran 2017년 1월 20일
편집: Vandana Ravichandran 2017년 1월 20일
Please try the "DurationInSeconds" property of the session object. You can create a listener using "addlistener" function that calls the "plot" Callback for the "DataAvailable" event. "DurationInSeconds" can be used to control for how long the background operation runs and the data is acquired for this duration. Once this interval completes, the listener invokes the "plot" callback.
The documentation has an example similar to what you want to implement: https://www.mathworks.com/help/daq/ref/dataavailable.html
  댓글 수: 2
Marco Tito Scordo
Marco Tito Scordo 2017년 2월 7일
Hello Vandana Ravichandran, thank you for your asnwer. At my knowledge, Duration in Seconds is used for managing duration of the acquisition only. So if I want to acquire 1min of signal it will have a value of 60, but the plot will show always 1 sec of aquisition 60 times. If I want to see 5 sec of signal in real time the problem is not solved and I don't have access to data anyway. Do you think is possibile another way to do it? Thank you
Walter Roberson
Walter Roberson 2017년 2월 7일
How are you doing the plotting?
The callback on the listener should have access to all of the data made available. However if you happened to be plotting in Simulink with a Scope block then that block might be configured to retain a limited number of points.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by