Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

temperature logger using thermocouples

I'm relatively new to this, so maybe there is something easy I'm missing.

I' writing an application to log temperatures from thermocouples (Type J) using C#, Measurement Studio (7.0), and DAQmx. I have card DAQ-6062E and terminal block SCB-68. I've wired the thermocouples in DIFF mode (positive lead to ACH1 [pin 33], negative lead to ACH9 [pin 66], and tied AIGND [pin 32] and ACH9 together). I also set the switches on the terminal block to DIFF mode. I'm using the internal CJC in SCB-68.

My application is reading the temperatures about 3-4 degC than what the actual temp is (at least according to using a handheld fluke with same thermocouples).

I've created the Task using both MAX and hardcoding the task (thought maybe my code was wrong), but the measure temp. is still low.

Just for fun, I created a task to see what temp. my CJC was and it is measuring correctly. This leads me to believe I'm doing something wrong.

Here's a snippet of code:

///
/// Initializes instance members of the class.
///

private void InitializeMyComponents()
{
taskRunning = false;
if (this.Variables != null)
{
asyncCallBack = new AsyncCallback(aiReaderCallBack);
task = new Task("TemperatureTask");
AIChannel aiChannel = task.AIChannels.CreateThermocoupleChannel("dev1/ai1:" + Convert.ToString(this.variables.NumOfChannels),
"Channel1",
this.variables.MinTemp,
this.variables.MaxTemp,
this.variables.Type,
AITemperatureUnits.DegreesC);
task.Timing.ConfigureSampleClock("",this.variables.Frequency, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);
task.Control(TaskAction.Verify);
aiReader = new AnalogMultiChannelReader(task.Stream);
}
}

I appreaciate any help given. If you need more info, let me know and I'll try and provide it.

Thanks in advance,
phil
0 Kudos
Message 1 of 4
(3,550 Views)
Hello Phil,

1) It is generally not recommended to tie ACH9 directly to AIGND. The recommended wiring is to put bias resistors bewteen ACH1 and AIGND and between ACH9 and AIGND.
2) When testing the task in MAX, do you have the CJC source set to Built In or Channel? Do you get different results based on what you have specified?
3) If you take the thermocouple out and short ACH1 to ACH9, what kind of readings do you get?

Thanks,
E.Lee
Eric
DE For Life!
0 Kudos
Message 2 of 4
(3,533 Views)
Thanks for responding.

I tried bias resistors between ch1 and gnd and ch9 and gnd and they didn't make a difference in the temp. I'm reading.

In MAX, I don't see a difference between an internal CJC and a constant CJC if I set the constant temp. to the internal CJC temp. If I set the constant CJC to something other than what it actually is, then I do see a difference.

If I jumper ch1 and ch9 together, I read basically the CJC temp. This seems to make sense because my terminal block is sitting on my desk open along with my thermocouples.

Thanks again,
Phil
0 Kudos
Message 3 of 4
(3,527 Views)
Hey Phil,

1) It is definitely expected to read the CJC temp when you short ch1 and ch9 but the curious thing is that there is no offset when it is shorted but there is an offset when the thermocouple is there. Based on this, it would seem like we are reading in the correct temperature, which leads us to...
2) What kind of CJC does the handheld fluke use to calculate the temperature? Because we are comparing the difference between two temperature measuring systems, it is difficult to say which reading is "correct" and which reading is producing an offset. 3-4 degrees doesn't seem like too signifanct of a discrepancy, but if the temperature difference is always 3-4 degrees and this behavior is highly constant and reproducible, then you can simply adjust for this in software by subtracting the offset.

Take care,
E.Lee
Eric
DE For Life!
0 Kudos
Message 4 of 4
(3,512 Views)