Skip to main content
Skip table of contents

TCVoltsToTemp [LJM User's Guide]

Converts thermocouple voltage to temperature.

Syntax

LJM_ERROR_RETURN LJM_TCVoltsToTemp(
int TCType,
double TCVolts,
double CJTempK,
double * pTCTempK)

Parameters

TCType [in]

The thermocouple type. Constants and and their valid temperature ranges are (alphabetically):

  • B = 6001, 250 to 1820 °C

  • C = 6009, 0 to 2319 °C

  • E = 6002, -200 to 1000 °C

  • J = 6003, -210 to 1200 °C

  • K = 6004, -200 to 1372 °C

  • N = 6005, -200 to 1300 °C

  • R = 6006, -50 to 1768 °C

  • S = 6007, -50 to 1768 °C

  • T = 6008, -200 to 400 °C

TCVolts [in]

The voltage reported by the thermocouple in volts.

CJTempK [in]

The cold-junction temperature in degrees Kelvin.

pTCTempK [out]

The calculated thermocouple temperature in degrees Kelvin.

Returns

LJM errorcodes or 0 for no error.

Remarks

Use this function to easily calculate thermocouple temperatures from voltage readings. When thermocouples are connected to the AIN0-AIN3 screw terminals, the cold-junction temperature can be obtained from AIN14, which maps to a nearby temp sensor inside most LabJack devices.

Example

Get the temperature of a K type thermocouple.

C
int LJMError;
double TCTempKelvin;
 
LJMError = LJM_TCVoltsToTemp(6004, 0.00134, 299.039, &TCTempKelvin);
printf("%f\n", TCTempKelvin);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.