It seems that you might have the ordering of your inputs slightly mixed up when you call the addClockConnection function. Here is a link to an example that might be helpful for resolving this issue.
National Instruments & Matlab
3 次查看(过去 30 天)
显示 更早的评论
Hello, I have using NI 9401, NI9237, and NI9215. When I run the code below,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
clc
devices = daq.getDevices
s = daq.createSession('ni')
s.DurationInSeconds = 10;
s.Rate=2000;
addAnalogInputChannel(s,'cDAQ1Mod2','ai0','Bridge')
addAnalogInputChannel(s,'cDAQ1Mod3','ai0','Voltage')
addCounterInputChannel(s,'cDAQ1Mod1','ctr0','PulseWidth')
addClockConnection(s,'cDAQ1Mod1/PFI1','External','ScanClock')
ch1=s.Channels(1)
set(ch1)
ch1.BridgeMode= 'Half'
ch1.NominalBridgeResistance = 350;
[data,time] = s.startForeground;
release(s)
plot(time,data(:,1))
title('Bridge')
figure(2)
plot(time,data(:,2))
title('Voltage')
figure(3)
plot(time,data(:,3))
title('Frequency')
figure(4)
plot(time,data(:,4))
title('PulseWidth')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I keep getting this error
NI Error -200414:
Requested sample clock source is invalid.
Property: DAQmx_SampClk_Src
Corresponding Value: Default
Device: cDAQ1
Task Name: _unnamedTask<79>
Status Code: -200414
Can anyone explain why I am getting this error?
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 National Instruments Frame Grabbers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!