이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
열전대에서 온도 데이터 수집하기
이 예제에서는 열전대 측정을 지원하는 NI™ 장치에서 데이터를 읽는 방법을 보여줍니다.
열전대를 지원하는 장치 검색
열전대 측정을 지원하는 장치를 검색하려면 daqlist
명령에서 반환된 테이블에 있는 장치에 액세스합니다. 이 예제에서는 NI 9213 장치를 사용합니다. 이것은 16채널 열전대 모듈이며 섀시의 모듈 6입니다.
d = daqlist("ni")
d = 12×4 table DeviceID Description Model DeviceInfo ___________ __________________________________ _____________ ____________________ "cDAQ1Mod1" "National Instruments NI 9205" "NI 9205" [1×1 daq.DeviceInfo] "cDAQ1Mod2" "National Instruments NI 9263" "NI 9263" [1×1 daq.DeviceInfo] "cDAQ1Mod3" "National Instruments NI 9234" "NI 9234" [1×1 daq.DeviceInfo] "cDAQ1Mod4" "National Instruments NI 9201" "NI 9201" [1×1 daq.DeviceInfo] "cDAQ1Mod5" "National Instruments NI 9402" "NI 9402" [1×1 daq.DeviceInfo] "cDAQ1Mod6" "National Instruments NI 9213" "NI 9213" [1×1 daq.DeviceInfo] "cDAQ1Mod7" "National Instruments NI 9219" "NI 9219" [1×1 daq.DeviceInfo] "cDAQ1Mod8" "National Instruments NI 9265" "NI 9265" [1×1 daq.DeviceInfo] "Dev1" "National Instruments PCIe-6363" "PCIe-6363" [1×1 daq.DeviceInfo] "Dev2" "National Instruments NI ELVIS II" "NI ELVIS II" [1×1 daq.DeviceInfo] "Dev3" "National Instruments PCIe-6363" "PCIe-6363" [1×1 daq.DeviceInfo] "Dev4" "National Instruments PCIe-6363" "PCIe-6363" [1×1 daq.DeviceInfo]
deviceInfo = d{6, "DeviceInfo"}
deviceInfo = ni: National Instruments NI 9213 (Device ID: 'cDAQ1Mod6') Analog input supports: -0.078 to +0.078 Volts range Rates from 0.1 to 1351.4 scans/sec 16 channels ('ai0' - 'ai15') 'Voltage','Thermocouple' measurement types This module is in slot 6 of the 'cDAQ-9178' chassis with the name 'cDAQ1'.
열전대 채널 추가
DataAcquisition을 만들고, 스캔 Rate
를 4 스캔/초로 변경하고, 측정 유형 Thermocouple
로 아날로그 입력 채널을 추가합니다.
dq = daq("ni"); dq.Rate = 4; ch = addinput(dq, "cDAQ1Mod6", "ai0", "Thermocouple");
채널 속성 구성
열전대 유형을 K로, 단위를 켈빈으로 설정합니다(열전대 유형은 센서 구성과 일치해야 합니다).
ch.ThermocoupleType = 'K'; ch.Units = 'Kelvin'; ch
ch = Index Type Device Channel Measurement Type Range Name _____ ____ ___________ _______ ________________ _____________________ _______________ 1 "ai" "cDAQ1Mod6" "ai0" "Voltage (Diff)" "+73 to +1523 Kelvin" "cDAQ1Mod6_ai0"
데이터 수집 및 플로팅
read
명령을 사용하여 데이터를 수집합니다.
data = read(dq, seconds(1));
plot(data.Time, data.cDAQ1Mod6_ai0);
ylabel('Temperature (K)');