필터 지우기
필터 지우기

Data Acquisition in GUI

조회 수: 3 (최근 30일)
Bohan Wu
Bohan Wu 2019년 8월 9일
답변: Geoff Hayes 2019년 8월 13일
Hi,
I wrote the below code into a seperate .m file and it works properly.
s = daq.createSession('ni');
addAnalogOutputChannel(s,'cDAQ1Mod2',0,'Voltage');
s.IsContinuous = true;
s.Rate = 10000;
data = linspace(-1,1,5000)';
lh = addlistener(s,'DataRequired', ...
@(src,event) src.queueOutputData(data));
queueOutputData(s,data)
startBackground(s);
But when I copy these code to a push button callback function in my GUI. It stops generate the signal.
Can anyone help me, soooo appriciated!

답변 (1개)

Geoff Hayes
Geoff Hayes 2019년 8월 13일

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by