01-04-2023 04:36 AM
Hello
My apologies if this is a double post.
The post before disappeared from my history, so I am not sure if I accidentally deleted it or not.
I have a MatLab error code during the data acquisition from cDAQ.
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
--------------
Here is the code I use.
I have used this code on the old computer, and it is running fine.
However, I had to change my computer recently due to a computing power issue, and the error appear.
------------------
% 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 appreciate any help you can provide.
01-06-2023 08:02 AM - edited 01-06-2023 08:02 AM
Hello Kritta,
Considering on error code description you need to specify the Sample Clock rate. I have attached an article which is the solution for this error in LabVIEW, but not for Matlab, just for you to understand the concept of working Timing VI in LabVIEW. So, I suggest you calling that function in DAQmx API in Matlab for solving this error.
Also, you mention, that there is no issue when you are running the code on the old computer. Could you please share that computer properties, software versions, to be clearly understand.
Regards)
01-08-2023 08:43 PM
Thank you very much for your reply. I just found a way to fix the problem.
Sorry for the late reply.