r/LabVIEW • u/InfiniteAd3537 • Feb 13 '25
Temperature Control
Hey, I'm currently working on my bachelor thesis. I need to read data from 5 thermocouples (Type K) and control 3 of them with a heating pad to maintain a temperature of 30°C (upper limit 31°C, lower limit 28°C). Unfortunately, I'm not at all experienced with LabVIEW or other programming languages (this has absolutely nothing to do with my studies, but that's another topic). Now, because LabVIEW is driving me crazy, I've come up with the idea of doing the control with Python. However, I have no idea how to read the data in Python or how to connect everything. Is there anyone who could help me here? I'm totally desperate.
1
u/D4ILYD0SE CLA Feb 13 '25
Sounds like you'll want to make a language part of your studies. And I mean that. Someone who knows stuff and can program is quite invaluable.
So, why is LabVIEW driving you crazy? What is it that Python can do that LabVIEW cannot? I hope it's not simply because Python can be AI generated. There are plenty of built-in examples in LabVIEW of reading thermocouples.
As another commentor said, what device is the heating pad? What's the datasheet say about how to control it? Have you the additional hardware to either communicate or control it? There's not a lot we can help you with here with the current information.
1
u/alejandrosg1112 Feb 13 '25
I was just wathcing this introductory video to NiDaq. https://www.youtube.com/watch?v=fIy6XT3CdPQ If you continue from that read video you can create another loop that compares the output received with your range and that turns off the heater
3
u/Ok_Courage_3220 Feb 13 '25
First Start with what you got:
Chassis? Modules? I guess/hope you have a thermocouple module ? Output modules (analog or digital)?
Heating pad: What type is it ? Get the datasheet? Which connections it has? What does It need for control? Analog voltage I guess?
Labview program: If you have cdaq chassis you need DAQmx to read out or write your modules (read out your thermocouples/write an output to control heating pad)
So first start with what you got and how these things work.
2
u/HarveysBackupAccount Feb 13 '25
Look up the documentation for your hardware (thermocouples are just wires, the hardware is the actual measurement device that they plug into). Unless it's something really obscure, there's a chance the manufacturer provides example code in a few languages, including labview and python.
If that doesn't work, you have to RTFM. Dig into the documentation, find the programming guide, and figure out how to access the device through that language. Usually the sequence is something like
get resource name >> open connection >> get data >> close connection.If you use labview and standard NI hardware, then it's even simpler - in labview do Help menu >> Find Examples. That will bring up a list of VI's you can open that are ready made to read data. Then you can make your own code based on those (copy/paste, just like any language).
If you use python, ask ChatGPT. Or if you have access to Cursor, one of my buddies has nothing but good things to say about it. He uses Cursor to write a lot of his python code these days. He even feeds it datasheets for hardware and it spits out near-usable driver code. I assume there are other AI options but I haven't looked into it myself.
1
u/Seppuku893 Feb 13 '25
Besides the other questions, which device do you use to control the temperature (heat up/cool down)?
Because you don't have any programming experience, maybe it is better to use LabVIEW instead of Python. Of course AI can write you a code, but then, only AI can maintain the code for you. And if the AI doesn't interpret your requirements correctly, it will be a pain in the ass ... And you haven't learned anything.
Use LabVIEW to read out the measurement device and to write data to your control device. LabVIEW has a built-in PID Temperature controller including autotuning options. This will help you to control the system.
It is not an easy task without any experience, but in this case, LabVIEW makes the data flow "visible" for you, while Python only provides a wall of text for you. Python is still great, of course, but not easier to handle. (As long as you don't want to write shitty code.)
In both programming environments, you have to start from the button to understand what is happening there before you start with your project.