LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Thermocouple data error

Hello all, 

 

I am working on a code that reads multiple thermocouples and records the data into a spreadsheet. I'm trying to get readings from 16 thermocouples and I only get good readings from one of the channels. The DAQ Channel that corresponds with my named thermocouple A6 is the only one that gives good readings at room temperature in degrees Farenheight. The other channels all give the same readings at around 4000 which is obviously incorrect. The main issue for right now is that all of these other channels have the same data when they should all be slightly different as they are all in room temperature. I'm using a cDAQ 9184 and NI 9213 DAQ card w/ DSUB and I believe all the thermocouples (Type K) are wired correctly. Any help at all would be appreciated. 

Download All
0 Kudos
Message 1 of 11
(410 Views)

I can't look at your code as it seems that you saved it as 2023 and I only use 2021.  If you could save it as an earlier version I (and many other forum members) could look at it, as quite a lot of us don't update versions every year.  I recommend saving back to 2019.

 

That said, there are still things that you can check.

 

First, you say that your NI 9213 DAQ uses DSUB.  Are you sure?  D-sub connections look like this:

Kyle97330_1-1752707483656.png

The module you say you have should look like this:

 
 

Kyle97330_4-1752707532498.png

 

If you truly are connecting to a D-Sub, then you're either using the wrong DAQ module or you've attached an adapter of some kind.

 

Second, can you go into more details on "I believe all the thermocouples (Type K) are wired correctly"?  Thermocouples work due to the interaction of two different metals or alloys, and it's important to be sure that the correct wire type goes to the correct polarity of your DAQ card.  It's also important that any extensions be of the same metal types as the junction metals.

 

Third, can you go into NI-MAX and find your DAQ and its card, and use the test panels there to get measurements?  If you can, that will help rule out whether it's your LabVIEW code set up wrong or if the signal to your DAQ/card is the real problem.  If you see the same results, be sure to check that your single "working" thermocouple responds as expected to temperature change.  You should be able to hold it in your hand and see it raise its temperature.

0 Kudos
Message 2 of 11
(379 Views)

I'll focus on the most pressing issue: you are only getting one valid reading from the batch of thermocouples. Inspecting your code, it looks like you are using the same "Thermocouple Channel" control for all of the AI Temperature virtual channels. A basic solution would be to create an array on the outside of your big "not cancelled" folder creation step that consists of all the named thermocouples that wind up in your datalog spreadsheet and create a daqmx virtual channel for each of them. Let me know if you want an example. From what I can tell, you're only making a single channel inside your first case structure.

 

For additional enhancements, I would recommend splitting apart your settings and definition phases of testing. For example, you might create a test settings file/value/variant/whatever and hand it off to some other process. That other process then reads in the settings as parameters, runs the test to those parameters, and writes the resulting data to file - potentially with the input parameters - as a final record.

 

You have large build array nodes and index array nodes which screams the use of a map or variant attribute (some form of tag-like lookup) as well. With a few helper vi's, you could make your test application easily extensible to an arbitrary number of named channels/thermocouples/whatever

0 Kudos
Message 3 of 11
(353 Views)

Hello Kyle,

When I said I was using a DSUB, I meant I was using an attachment that plugged directly into my NI 9213. This attachement is where I have all of the thermocouples wired up. 

Secondly, I understand the wiring conventions for the different types of thermocouples. They are all the same type and follow the traditional yellow to positive and red to negative wiring. 

Lastly, I testing in NI-MAX and each channel does in fact show different results. However, these results (being measued in Farenheight) are all around 4169 with small variations in the decimal. I have (hopefully) attached a 2021 version of my VI. Thank you for your help!

0 Kudos
Message 4 of 11
(331 Views)

Hey otto, 

When you recommended creating a virtual channel for each named thermocouple, I think I am already doing that in the "pyhsical channel" control on the front panel for the one place I have the "DAQmx Create Channel." I input all of my channels I'm trying to read from at once like so: "cDAQ9184-1896BC6Mod1/ai0:15" - I thought the "0:15" was calling all 15 channels of my DAQ card. I also plan on adding even more thermocouples and adding the create channel to each of them would make for a very busy code at the end. 

0 Kudos
Message 5 of 11
(328 Views)

Looking at your code you are not creating all 15 channels. You are only creating one. You will need an array of channels that detail out each channel:

Currently what you are doing.

aeastet_0-1752767859675.png

You can create a task that contains all of the channels that you want to read. You would build virtual channels or one task that has everything contained in it. You need to look at examples of reading multiple AI channels.  

 

Tim
GHSP
0 Kudos
Message 6 of 11
(319 Views)

Here is how I would do this:

Create Virtual channels:
Open NI Max and select data neighborhood:

Right click and create new:

aeastet_0-1752768547892.png

 

Now select NI-DAQmx Global Virtual Channel:

aeastet_1-1752768598544.png

 

Now select Acquire Signals and then Analog Input then Temperature and finally Thermocouple:

aeastet_2-1752768697610.png


Now select the channel the thermocouple is connected to:

aeastet_4-1752768905195.png

 

 Give your channel a name:

aeastet_5-1752768940589.png

 

Now you set up your channel in this area.

aeastet_6-1752769008564.png


Create a channel for each connection. You should be able to right click and duplicate the additional channels and assign them a AI channel.

aeastet_7-1752769111138.png

 





Tim
GHSP
0 Kudos
Message 7 of 11
(309 Views)

Now you can set up your channels by adding an array of virtual channels and change the daq to match this:

aeastet_0-1752769413687.png

 

Tim
GHSP
0 Kudos
Message 8 of 11
(308 Views)

OK I updated your VI to use this method and I cleaned it up a bit:

Tim
GHSP
Message 9 of 11
(300 Views)

Hey Tim,

 

I read your replies and I modifid the VI myself with your suggestions. I put all of my channels ai0 - ai15 into NI-DAQmx Global Virtual Channels and then put them into an array on the front panel. Now, the same issue occurs where they all read the same thing. Even the one that was reading correctly now reads the same as the others.

 

Thanks for editing the VI yourself, unfortunately, I can't open it as it's in a newer version of LabVIEW. I can't update my LabVIEW from 2023 version to open it as I don't have authority over it on the computer I'm using. 

 

Even though it isn't working just yet, I appreciate your help!

0 Kudos
Message 10 of 11
(291 Views)