01-27-2022 05:17 AM
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
01-27-2022 08:37 AM - edited 01-27-2022 08:37 AM
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…
01-27-2022 12:12 PM
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.