simultaneous digital and analog output using data acquisition toolbox

20 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Sarah McIntyre
Sarah McIntyre le 23 Avr 2015
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).

Plus de réponses (0)

Catégories

En savoir plus sur Data Acquisition Toolbox Supported Hardware dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by