Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Temperature measurement with NI6220

Ok, here's what I am trying now:

 

Create a task - DAQmxCreateTask

Create a thermistor channel for this task - DAQmxCreateAIThrmstrChanVex

Create a thermocouple channel for this task (DAQmxCreateAIThrmcplChan) using the cjcsource option DAQmx_Val_Chan and specifying the thermistor channel as the source channel

Start this task - DAQmxStartTask

Get the temperature - DAQmxReadAnalogScalarF64

Stop the task - DAQmxStopTask

Clear the task -DAQmxClearTask

 

I'm getting an error -200488 when I create the thermocouple channel.  What is a -200488 error?

 

I don't have anything hooked up yet but I doubt that is the cause of the error.

 

A few more details (pardon my Delphi):

 

Creating the thermistor channel

TmPcName:='Dev1/ai19';

    iStatus:=DAQmxCreateAIThrmstrChanVex(
      TcTaskHandle,                 // Task handle
      @TmPcName,                 // Physical channel name
      @TmChName,                 // Channel name
      -80,                                   // Min range
      80,                                    // Max range
      DAQmx_Val_DegC,        // Units, °C
      DAQmx_Val_ResistanceConfiguration_2Wire,  // 2-wire, 4-wire, etc.
      DAQmx_Val_ExcitationSource_External,      // Excitation source, internal
      1,                                     // Excitation value
      9.376e-4,                         // a
      2.208e-4,                         // b
      1.276e-7,                         // c
      30000);                            // Reference resistor
 

Creating the thermocouple channel:

TcPcName:='Dev1/ai23';

 

    iStatus:=DAQmxCreateAIThrmcplChan(
      TcTaskHandle,               // Task handle
      @TcPcName,                // Physical channel name
      '',                                     // Channel name
      0,                                    // Min range
      1000,                              // Max range
      DAQmx_Val_DegC,      // Units
      DAQmx_Val_DegC,      // Thermocouple type
      DAQmx_Val_Chan,       // CJC source
      25,                                  // CJC value, if DAQxm_Val_ConstVal
      @TmPcName);             // CJC channel, if DAQxm_Val_Chan
 

I could also use some help figuring out how to hook up the termistor.

 

Thanks,

Mike

 

0 Kudos
Message 11 of 14
(1,273 Views)

Progress.

 

The -200488 error was my fault, obviously.  I had tried to create the same task twice.

 

It looks like 4-wire configuration is required for voltage excitation thermistor measurements.

 

Also, it looks like external excitation is required in my case, PCI-6229.

 

Everything is working if I use a CJCConstant.  I get an error saying "Requested value is not a supported value for this property.", which occurs when I call DAQmxStartTask.  I wonder which property this message is referring to.

 

I guess this is becoming my TC-measurement blog.

0 Kudos
Message 12 of 14
(1,271 Views)

Hello m610,

 

You're right, your posts have turned out a bit like a blog 🙂

 

After reading through your posts, I was going to point out that you cannot measure resistance with the 6229 cards, only voltages, but it looks like you discovered this in the last post. If you want to measure resistance, as with an RTD, for your 6229 DAQ card you will need to supply an external known excitation current, and then measure votlage and use post processing to find the resistance and then temperature. This can be done with a power supply. Otherwise, you will need to look at purchasing hardware specifically designed to measure resistance or RTDs and that will have built in current excitation. Let me know if you would like any pointers on what hardware is appropriate.

 

Are you having any further errors I can help you with? If you include screenshots of the error message and your code I can perhaps help you troubleshoot it.

 

Regards,

Mallori

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 13 of 14
(1,241 Views)

Thanks.

 

Yes, I think I am finnaly on the right track.  I'm trying to use a thermistor channel to get my junction temperature and the thermocouple channels will refer to this channel for the CJC value.  I'll use a 4-wire setup. I've purchased some thermistors and a 100 microamp current source chip that can be configured to operate at 50 microamps, very close to the limit recommended to avoid self heating of the thermistor.

 

My current problem is the "Option not supported..." type message I get when I try to configure the thermistor channel and thermocouple channels in the same task.

0 Kudos
Message 14 of 14
(1,223 Views)