LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Single Value from Thermocouple Module

Hello All,

 

I'm trying to read a single value from a thermocouple module. Expect, it is always returning the same value when I run it, when I would expect it to be changing every time. This is because simulated devices values follow a sinusoidal shape. 

 

Any help would be extremely thankful (Thanksgiving Holiday here in Canada). 

 

I have figured MAX with a cDAQ 9174 as "cDAQ3"

And I have two thermocouple modules NI-9214 as "cDAQ3Mod1" and  "cDAQ3Mod2"

 

The vi is saved to 2017 version. 

0 Kudos
Message 1 of 7
(1,675 Views)

The NI-9214 has an aggregate max sample rate of 68 samples/second.

 

How many channels are you trying to get data from? How fast are you trying to get each new sample? I noticed in the vi that you have the rate set to 1000 Hz which will not work for this card (even with only one channel).

 

If you are using all 16 channels on the card the max sample rate you can get is 4.25 Hz (68/16). 

 

Message 2 of 7
(1,668 Views)

Are you measuring real thermocouples from a real cDAQ module?  Because you talk about simulated signals.

 

How are you running this?  Your VI is "one shot" meaning it will run, execute each of those functions and stop.

 

If you are using simulated signals, you will get the same value every time because starting and stopping the task starts and stops the simulated value thus resetting it.  So it will be 0 each time you press run.

Message 3 of 7
(1,637 Views)

Hi adekruif,

 

I switched the rate to 60, but I am still having the same issue.

 

I just need one channel and the timing isn't that important. If it processes in a second that's fine.

 

Just to clarify, the data is being read on demand. Everything it runs, it should just give one channel value. 

0 Kudos
Message 4 of 7
(1,634 Views)

Hi RavensFan,

 

Right now I am testing with simulated cDAQ, but the code is meant for a real cDAQ. Maybe I should test it with hardware to see if the error goes away.

 

Yes, running the code as one shot! The user is to click to see the current temp value. 

 

Ok, yes that's what I thought might be happening is its resetting each time. So, I think testing with hardware is the solution.

0 Kudos
Message 5 of 7
(1,632 Views)

Hi jescameron,

 


@jescameron wrote:

Right now I am testing with simulated cDAQ, but the code is meant for a real cDAQ. Maybe I should test it with hardware to see if the error goes away.

Yes, running the code as one shot! The user is to click to see the current temp value. 


Your sample rate is set to 1000S/s: your hardware does not support that rate!

Why do you use "continuous samples" mode for "one value on demand"?

The CJC channel constant is empty: why don't you use the CJC of the NI9214 module?

Why do you set a constant 25°C CJC temperature?

Why do you fiddle with DAQmx buffer size (at DAQmxTiming) when you want to read just one sample?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(1,592 Views)

GerdW,

 

Thanks for your inquiries. 

 

Your sample rate is set to 1000S/s: your hardware does not support that rate!

Switched. Good point. 

Why do you use "continuous samples" mode for "one value on demand"?

I had tried one value on demand but wasn't getting any success so I switched it. Although looking back and knowing the solution now; I should not have messed around with configurations.

The CJC channel constant is empty: why don't you use the CJC of the NI9214 module?

Why do you set a constant 25°C CJC temperature?

All cold junction was just temporally, until we have hardware. 

Why do you fiddle with DAQmx buffer size (at DAQmxTiming) when you want to read just one sample?

Same reason as above, was not seeing the result I expected, so was trying different options. 

 

We got hardware test going and its working well. Thanks everyone for the help. 

0 Kudos
Message 7 of 7
(1,530 Views)