Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

MATLAB Error during using cDAQ9184

Hello

 

I have a problem when running MATLAB code to acquire data from cDAQ9184.

I would appreciate it if someone could help me with this issue.

Here is the error code.

-------------

NI Error -201087:
Task contains physical channels on one or more devices that require you to specify the Sample Clock rate. Use the Sample Clock
Timing function/VI to specify a Sample Clock rate.
You cannot specify a Sample Clock rate if Mode is set to On Demand.
Device: cDAQ9184-182032A

Task Name: _unnamedTask<F>

Status Code: -201087

-------------

 

The code I use is here.

 

------------

% Set up the NI DAQ device
dq = daq("ni"); % Find avaliable NI Device
dq.Rate = 7142.8571; % Set Fequency of NI Devices

% Add an input channel for the analog input signal
ch1 = addinput(dq, "cDAQ9184-182032AMod2", "ai1", "Bridge"); % Add ai 0 input as Bridge modes
ch1.BridgeMode = "Full"; % Full mode
ch1.NominalBridgeResistance = 350; % Resisitance of the strain gauge

ch2 = addinput(dq, "cDAQ9184-182032AMod2", "ai2", "Bridge"); % Add ai 0 input as Bridge modes
ch2.BridgeMode = "Full"; % Full mode
ch2.NominalBridgeResistance = 350; % Resisitance of the strain gauge

ch3 = addinput(dq, "cDAQ9184-182032AMod2", "ai3", "Bridge"); % Add ai 0 input as Bridge modes
ch3.BridgeMode = "Full"; % Full mode
ch3.NominalBridgeResistance = 350; % Resisitance of the strain gauge

tic
while(toc<5)
Test = read(dq);
disp(Test)
pause(0.1);
end

------------

 

I use this code on another PC, and it is run fine.

I also use the same Matlab version, 2022b.

I appreciate any help you can provide.

0 Kudos
Message 1 of 1
(711 Views)