Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9211 support

Solved!
Go to solution

Hello,

 

I am using a cDAQ-9171 with a NI 9211 to read some thermocouples. I am looking to eventually write some C++ code that reads temperature from this device. I am looking at the DAQmx ANSI C example code, and I am having trouble running that. Is there any good documentation on configuring the channels to be read?

I am currently getting the following output when running the "ContThrmcplSamps-IntClk.c" sample code.

sbapplied13_0-1661293670969.png

 

Need some support finding what values to put into the following functions to read channel 0.

sbapplied13_1-1661293714713.png

 

Thank you,

Sahil Bhakta

0 Kudos
Message 1 of 2
(243 Views)
Solution
Accepted by topic author sbapplied13

Hi Sahil,

 

I would suggest that you check NI MAX, under Devices and Interfaces, to make sure your DAQ device is properly connected to your system.

As you already know, the error popping up is due to not properly specifying the module/channel of the thermocouple.

 

Below is a snippet of the original, unedited "ContThrmcplSamps-IntClk.c" sample code that you are working with:

afort_0-1661938284225.png

At the 146th line, you can see many variables, such as chan, min, max. These are the ones you need to substitute for your own values to make the code work. The variable chan is the one that determines which module/channel your system is reading from.

In order to know the name of this module/channel, you need to check your NI MAX software, under Devices and Interfaces. Once you are there, click your cDAQ device and take a look into Slot Details:

afort_1-1661939173642.png

These are the different modules on my DAQ device. If you notice, on the 2nd slot I have my NI 9211. The name of that slot being cDAQ1Mod2. Now you know the name of the module, but still require the name of the channel that your Thermocouple is connected to.

afort_2-1661939697463.png

I have mine connected to the AI 0+, AI 0-. The channel name for that is ai0.

Therefore, my module/channel name for the TC reading is cDAQ1Mod2/ai0.  I substitue that in place of chan-- it should look like this:

afort_3-1661940054939.png

 

Reach out if you have further questions,

 

Aleix Fort

 

 

 

Message 2 of 2
(174 Views)