simultaneous digital and analog output using data acquisition toolbox

20 ビュー (過去 30 日間)
Sarah McIntyre
Sarah McIntyre 2015 年 4 月 22 日
回答済み: Sarah McIntyre 2015 年 4 月 23 日
Hello,
I am using a NI-DAQ 6216 with Matlab's Data Acquisition Toolbox. The device has two analog output channels and I need to use both simultaneously to output arbitrary waveforms. At the same time, I want to use a digital output to drive an LED that signals when the analog signals are produced.
I tried to follow this example using the session based interface: http://au.mathworks.com/help/daq/generate-signals-on-both-analog-and-digital-channels.html
s = daq.createSession('ni');
addAnalogOutputChannel(s,'Dev1',0:1,'Voltage')
addDigitalChannel(s,'Dev1','Port0/Line0','OutputOnly')
And I get the message:
Warning: A channel that does not support clocked sampling was added to the session. Clocked operations using startForeground and startBackground will be disabled. Only on-demand operations using inputSingleScan and outputSingleScan can be done.
So I can't use startForeground and startBackground, which I need to produce my analog outputs. Is there any way to do what I want?
Sarah

採用された回答

Sarah McIntyre
Sarah McIntyre 2015 年 4 月 23 日
I solved this by setting up two sessions, one for analog and one for digital (I got the idea from http://au.mathworks.com/matlabcentral/answers/24757-daq-session-based-input-is-it-possible-to-have-different-clocks-for-input-and-output).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData 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