Continuous digital output in session based interface.
조회 수: 14 (최근 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에서 Simultaneous and Synchronized Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!