How to create a clocked digital output?
3 views (last 30 days)
Show older comments
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?
0 Comments
Answers (0)
See Also
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!