How to draw Output Data in realtime fo NIDAQ?

조회 수: 2 (최근 30일)
Sergey Makovkin
Sergey Makovkin 2016년 9월 7일
편집: Sergey Makovkin 2016년 9월 7일
I use a code:
Session = daq.createSession('ni');
addAnalogOutputChannel(Session, 'Dev2', 0:1, 'Voltage');
Session.IsContinuous = true;
Session.Rate = 10000;
data(:, 1) = [linspace(-1, 5, 5000) linspace(5, -1, 5000)]';
data(:, 2) = [linspace(-1, 10, 5000) linspace(10, -1, 5000)]';
lh2 = addlistener(Session, 'DataRequired', @(src, event) src.queueOutputData(data));
queueOutputData(Session, data);
subplot(2, 2, 1);
plot(data(:, 1))
subplot(2, 2, 2);
plot(data(:, 2))
startBackground(Session);
And I need to draw in realtime on plot point by point. How can I do it via listener?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by