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 are (alphabetically):

B = 6001

C = 6009

E = 6002

J = 6003

K = 6004

N = 6005

R = 6006

S = 6007

T = 6008

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.