Cannot get the clocked sampling work on outputs from digital channels
4 views (last 30 days)
Show older comments
I'd like to generate TTL signal from digital channels of NI PCI 6110 (using BNC2110 board too connect wires). The code is as follows:
%add digital channels
s = daq.createSession('ni');
s.Rate = 30000;
addDigitalChannel(s,'Dev1','Port0/Line0:2','OnotputOnly');
%clock
sClk = daq.createSession('ni');
sClk.addCounterOutputChannel('dev1',1,'PulseGeneration');
clkTerminal = sClk.Channels(1).Terminal;
sClk.Channels(1).Frequency = s.Rate;
sClk.IsContinuous = true;
sClk.startBackground;
s.addClockConnection('External',['dev1/' clkTerminal],'ScanClock');
Then every time when it steps through addDigitalChannel, the warning message comes up:
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.
And then S.Rate becomes 0. Any suggestions? So far I've also tried moving the clock up before adding the channels or using the "addAnalogInput" (shared clock method), still I got the same message at the same line of codes. I'm running R2013b. Appreciate any hints and possible solutions.
Thanks
mc
2 Comments
Walter Roberson
on 5 May 2015
On the line
addDigitalChannel(s,'Dev1','Port0/Line0:2','OnotputOnly');
I think you misspelt OutputOnly
I do not know if that would have any effect.
Answers (0)
See Also
Categories
Find more on National Instruments Frame Grabbers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!