How to create a clocked digital output?

3 views (last 30 days)
Rahul Raj Mechoor
Rahul Raj Mechoor on 18 May 2015
Edited: Walter Roberson on 19 May 2015
I am trying to create a clocked digital output using an array of values. I am using NI cDAQ-9174 and NI9401 for digital output and specs say both devices have counter channels. But when I execute the code, it gives me an error saying
Warning: This change caused queued output data to be flushed. Use queueOutputData
to queue data before starting the object.
To use the session object in clocked mode with the digital output channel
'port0/line0', an external clock must be supplied. See documentation on Digital
Clocked Operations Using Session-Based Interface for more information.
The code I used is:
s = daq.createSession('ni')
ch = addDigitalChannel(s,'cDAQ1Mod4','Port0/Line0','OutputOnly')
s.Rate = 10000
y = ones(500,1);
queueOutputData(s,y)
s.startForeground
What change should I make in my code for this to work?

Answers (0)

Categories

Find more on Simultaneous and Synchronized Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!