Question: How can I measure temperature using B-Type thermocouples and a generic DVM? Answer: You can measure temperature with a generic DVM by doing some arithmetic conversions in your computer. To demonstrate the procedure, we will use a E1326B with a E1347A multiplexer. The E1326 driver (which supports thermocouple temperature measurements) is used so that the manual procedure can be verified by the built-in temperature function. An example program in HP BASIC is provided. Measuring thermocouple temperature requires that the voltage at the end of the thermocouple be measured at a isothermal block. The temperature of the isothermal block must be known. For the E1347, the isothermal block temperature is determined by a thermistor embedded in a block of aluminum. The procedure to convert B-type thermocouple voltage to temperature: Use the subprogram Degrees_init to set "F" or "C" for degrees F or degrees C (line 510). Measure the resistance of the 5000 ohm thermistor on a E1347 isothermal terminal block (lines 560-590). Use the function FNThr5(Thr_ohms) to convert this resistance to the temperature of the isothermal block (line 660). Measure the voltage of a thermocouple (lines 600-630). Use the function FNThmc_b(Voltage,Ref_temp) to convert the thermocouple voltage, and block temperature to the to temperature of the thermocouple (line 700). This routine was ported from the DACQ/300 Temperature Library. It is valid from 130 deg C to 1820 deg C. Lines 450-710 measure a thermocouple directly using the MEAS:TEMP command and then using the MEAS:RES, MEAS:VOLT:DC measurement functions and the FNThr, FNThmc, Degrees_init routines. The result are in degrees C. The two methods produce the same result. When this program was run, the thermocouple was at room temperature which is below the valid range. Thus the overload readings, but it does demonstrate how to verify operation. Lines 730-810 print out a table of voltage vs temperature with a block reference temperature of 0 degrees C. The results are in degrees C. Comparison of this table to standard thermocouple tables shows validity. ```10 ! re-save "TEMP_B" 20 ! This main line code is reserved as a error handling shell 30 ! All application code must be at lower level context 40 ASSIGN @Sys TO 70900 ! define I/O paths 50 ASSIGN @Dvm TO 70903 60 COM /Instr/ @Sys,@Dvm 70 COM /Hpnav_temp/ Hpnav_degrees\$[1],Hpnav_errvalu 80 ON TIMEOUT 7,3 GOTO End !Turn TIMEOUTS to errors--this branch never taken 90 ON ERROR RECOVER Kaboom !This handles timeouts and errors not handled 100 ! at lower level contexts 110 Main ! Put application code in this sub 120 PRINT "Checking for E13xx Errors at the end of the program" 130 E13xx_errors 140 GOTO End 150 Kaboom:PRINT "" 160 PRINT ERRM\$ 170 PRINT "Checking for E13xx Errors as a BASIC Error has occurred" 180 E13xx_errors 190 End:END 200 ! 210 SUB E13xx_errors !This sub reads all errors from E13xx instruments 220 COM /Instr/ @Sys,@Dvm 230 COM /Hpnav_temp/ Hpnav_degrees\$[1],Hpnav_errvalu 240 DIM A\$[128] 250 ABORT 7 260 CLEAR @Dvm 270 REPEAT 280 OUTPUT @Dvm;"SYST:ERR?" 290 ENTER @Dvm;A,A\$ 300 PRINT "DVM ERROR ";A\$ 310 UNTIL A=0 320 ! 330 CLEAR @Sys 340 REPEAT 350 OUTPUT @Sys;"SYST:ERR?" 360 ENTER @Sys;A,A\$ 370 PRINT "SYSTEM ERROR ";A\$ 380 UNTIL A=0 390 SUBEND 400 ! 410 SUB Main !This subroutine is treated as the main line 420 COM /Instr/ @Sys,@Dvm 430 !Put application code here 440 COM /Hpnav_temp/ Hpnav_degrees\$[1],Hpnav_errvalu 450 ! MEASURE TEMPERATURE USING THE BUILT IN TEMP FUNCTION 460 OUTPUT @Dvm;"MEAS:TEMP? TC,B,(@100)" 470 ENTER @Dvm;Temp1 480 PRINT "Measured temperature of channel 0 ";Temp1 490 ! 500 ! NOW MEASURE TEMP BY MEASURING VOLTS AND OHMS THEN COMPUTING TEMP 510 Degrees_init("C") 520 ! MEASURE BLOCK TEMPERATURE " 530 OUTPUT @Dvm;"MEAS:TEMP? THER,5000, (@193)" 540 ENTER @Dvm;Meas_block_temp 550 PRINT "MEASURED BLOCK TEMPERATURE ";Meas_block_temp 560 ! MEASURE THERMISTOR RESISTANCE 570 OUTPUT @Dvm;"MEAS:RES? (@193)" 580 ENTER @Dvm;Therm_res 590 PRINT "THERMISTOR RESISTANCE ";Therm_res 600 ! MEASURE CHANNEL 0 VOLTAGE 610 OUTPUT @Dvm;"MEAS:VOLT:DC? (@100)" 620 ENTER @Dvm;Ch0_volts 630 PRINT "CHANNEL 0 VOLTS ";Ch0_volts 640 ! 650 ! Now convert resitance to isothermal block temperature 660 Block_t=FNThr5(Therm_res) 670 PRINT "Calculated block temp ";Block_t 680 ! 690 ! Now convert channel 0 voltage to temperature 700 Temp2=FNThmc_b(Ch0_volts,Block_t) 710 PRINT "Calculated temperature of channel 0";Temp2 720 ! 730 ! Now generate a table of voltage vs temp 740 PRINT "" 750 PRINT " Table of voltages vs temp in C for block temp of 0 deg C" 760 PRINT " Compare this to your thermocouple tables " 770 Degrees_init("C") 780 FOR V=0.E+0 TO 1.E-3 STEP 1.00E-4 790 Temp=FNThmc_b(V,0) 800 PRINT "Voltage ";V;" Temperature ";Temp 810 NEXT V 820 SUBEND 830 ! 840 SUB Degrees_init(Degrees\$) 850 REM COPYRIGHT HEWLETT PACKARD CO. 1992, ALL RIGHTS RESERVED 860 Degrees_init:! 870 COM /Hpnav_temp/ Hpnav_degrees\$[1],Hpnav_errvalu 880 Hpnav_errvalu=1.E+38 890 SELECT TRIM\$(UPC\$(Degrees\$)) 900 CASE "F" 910 Hpnav_degrees\$="F" 920 CASE ELSE 930 Hpnav_degrees\$="C" 940 END SELECT 950 Exit:SUBEND 960 ! 970 ! 980 DEF FNThr5(Thr_ohms) 990 REAL Rhi,Rlo,T,W,A,B,C,R 1000 COM /Hpnav_temp/ Hpnav_degrees\$[1],Hpnav_errvalu 1010 READ Rhi,Rlo,A,B,C 1020 IF Thr_ohms>Rhi THEN RETURN Hpnav_errvalu 1030 IF Thr_ohms70 THEN RETURN Hpnav_errvalu 1250 Cuv=Voltage+Parms(8,1)+Reft*(Parms(8,2)+Reft*(Parms(8,3)+Reft*Parms(8,4))) 1260 IF CuvVhi+1.E-6 THEN RETURN Hpnav_errvalu 1280 I=7 1290 IF Cuv ```