Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 17 Devices > 17.7 LabJack UE9 / U6 / U3 > 17.7.5 Analog and Digital I/O > 17.7.5.3 Thermocouples

17.7.5.3.2 Unamplified Thermocouple Readings

Scroll Prev Top Next More

This applies only to the U6, UE9 and UE9 Pro because the U3 doesn't have the precision to read the low voltages output by a thermocouple.  Please see the last section for a full explanation.

1) Right click on SEQUENCES: in the Workspace and select Add Sequence.  Give it the name StartUp and click OK.  

2) In the sequence editor, check the box labeled Auto-Start, then put the following in the script:

 

global offset = 0

 

using("device.labjack.")

include("c:\program files (x86)\labjack\drivers\labjackud.h")

 

AddRequest(0, LJ_ioPUT_CONFIG, LJ_chAIN_RESOLUTION, 18, 0,0)

AddRequest(0, LJ_ioPUT_AIN_RANGE, 0, LJ_rgUNI5V, 0, 0)

GoOne(0)

The first line is used to adjust for any voltage offset in the signal.  The next two lines are the standard lines required to access the LabJack UD from script.  The next three lines set the gain and resolution of the UE9.  We've chosen the most generic range for AIN0.  Your UE9 might be able to use a tighter AIN range and achieve higher precision.

3) Click Apply, then go to Debug - Begin this Sequence from the DAQFactory menu to actually set these settings.

4) Create a channel for AIN0 as described back in section 17.7.3.1 to read the voltage.

5) To accurately read the thermocouple we also need to read the temperature of the cold junction which is essentially the temperature of the LabJack.  This is internal A to D channel #133.  Create another channel called CJC to read A to D channel #133.  Click Apply to save your changes and start reading the inputs.

Now we can convert the thermocouple voltage input into temperature:

6) Click on CONVERSIONS: in the workspace, then Add.  Call the conversion Thermocouple and put the following Formula:

 

TypeK(Value - Offset, CJC[0]-273.15)

There are different formulas for each thermocouple type, such as TypeJ().

7) Go back to the channel table and for the AIN0 channel you created in step 4, select the Thermocouple conversion you just created and click Apply.

That is it.  You can now display or plot the input channel.  You can adjust the offset variable to adjust for any bias in the LabJack by changing it in the sequence we created in step 2 and rerunning it, or by creating a screen control to adjust its value (shown in the sample).