LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Am I setting up the thermocouple readings correctly?

I've written a program that has multiple test fixtures. When a test is initiated the fixture channel settings are used to create the correct tasks and open relays for the selected fixture. A sample is then heated to different setpoints with a PID heating loop, and data is collected and analyzed.

When I create the thermocouple task, i'm using a sample clock node set to continuous readings, 1 channel, 50 readings per second. The PID node does not have any timing specified. I did this to limit the speed of the PID loop, and so that I could convert loop count to seconds to display on the graph. Is this correct and OK to control the timing? Previously I had ran into problems if the thermocouple timing was faster than the PID loop and older data was being displayed instead of most recent measurements. My current code seems to prevent any issues, but I'm not sure if its the correct setup. I've attached two images of the thermocouple create channel code and the PID subvi code (the subvi is inside a loop but not shown).

Lastly I have a simpler subvi for testing the thermocouple readout running a full test. Typically when I run this code, the very first temperature that is displayed is off, such as showing 200 on a room temperature thermocouple. It quickly corrects to the correct measurement, but because there is a 500ms wait between each reading, it is noticeable. Is there something that I'm doing wrong causing this? Is it because I create a thermocouple channel and start the task before i've closed the relays that connect the thermocouple? Or am I just taking a reading too soon after the relay is closed? Does the code itself look ok?

Thanks

0 Kudos
Message 1 of 3
(1,111 Views)

Hi ukerekais,

 


@ukerekais wrote:

Is there something that I'm doing wrong causing this?


Well, most probably there is a problem in your hardware or in your software!

Unfortunately you forgot any software (aka VIs)!

Not even the images you wrote about came with your message - but keep in mind: we cannot debug/edit/run images with LabVIEW, so we prefer real code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,095 Views)

I second what GerdW said.

 

In my experience most thermocouple devices have a pretty slow update rate, around 500ms sounds about right to me. Unless you are working with a very small thermal mass, temperature isn't expected to change that quickly. You may want to have a delay before getting your first reading, or just read 2 samples before you try and do anything with the signal.

0 Kudos
Message 3 of 3
(1,070 Views)