Error Message for Thermocouple: Subsystem in use

3 views (last 30 days)
I'm trying to control my theromcouple using MATLAB. However, I always receive the following error message:
"Error using Thermocouple (line 4)
dt Error 20:
Subsystem in use"
However, the thermocouple is only connected to my computer, so I can't understand why the "subsystem" would be in use. Here's my code:
devices = daq.getDevices
s = daq.createSession('dt');
addAnalogInputChannel(s,'DT9828(00)',0, 'Voltage');
s.Rate = 1
tc = s.Channels(1);
set(tc)
[data,time] = s.startForeground();
plot(time, data)
xlabel('Time (secs)');
ylabel('Voltage (V)');
Final note: I've been following the instructions on this article: https://www.mathworks.com/help/daq/examples/acquire-temperature-data-from-a-thermocouple.html

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!