Continuous digital output in session based interface.
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am using the following code for 'trying' to generate digital output across six lines. I have included an analog input channel to check if the output lines are working (and physically connected them). The code runs without any errors but there is no digital output from the NI PXI 6224 card. I can get the digital lines to output using outputSingleScan command but it just doesn't work otherwise in startForeground or startBackground mode. Help please!
DO = daq.createSession('ni');
addDigitalChannel(DO,'PXI1Slot4','port0/line0:5','OutputOnly');
addAnalogInputChannel(DO,'PXI1Slot3','ai10','Voltage')
addClockConnection(DO,'PXI1Slot3/PFI0','PXI1Slot4/PFI0','ScanClock');
DO.IsContinuous = true;
DO.Rate = 100;
OutputData = decimalToBinaryVector(sort(rem(0:999,64)),6);
DO.queueOutputData(OutputData);
DO.NotifyWhenScansQueuedBelow = 500;
addlistener(DO,'DataRequired',@(src,event) src.queueOutputData(OutputData));
DO.NotifyWhenDataAvailableExceeds = DO.Rate;
addlistener(DO,'DataAvailable',@(src,event) disp(mean(event.Data)));
DO.startBackground;
Thanks,
Kapil
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Analog Signal Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!