simultaneous digital and analog output using data acquisition toolbox

20 次查看(过去 30 天)
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 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