Info

この質問は閉じられています。 編集または回答するには再度開いてください。

NI9265 - data queue not looping

1 回表示 (過去 30 日間)
topdawgnate
topdawgnate 2011 年 9 月 20 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Try as I might, I can't seem to get my module to loop through a set of data points continuously. I've made the code exactly as the demo's and session.m file describe, but to no avail. Anyone know what I'm missing??
clear;
s = daq.createSession('ni');
s.addAnalogOutputChannel('cDAQ9191-1629439Mod1',1,'Current');
outputData = linspace(0,.02,2200)';
s.IsContinuous=true;
lh = addlistener(s,'DataRequired',@queueMoreData);
s.queueOutputData(outputData);
s.startBackground;
s.stop;
delete(lh)
in a seperate m file I have this:
function queueMoreData(src,event)
s.queueOutputData(linspace(0,.02,2200)');
end
I run each of the cells individually (ctrl+enter). Each time, the code runs and the module ramps it's current output and then holds at it's last value. I want it to cycle through a few more times, but I can't seem to get this to work properly.
Thanks for your help in advance.
Nate

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by