02-14-2025 06:55 AM
Hi, everyone,
I'm new to LabVIEW and working on a project where I need to control parameters via serial communication based on thermocouple measurements. I'm using an NI 9213 module, which acquires data at 75 S/s, causing my main loop to take around 220 ms per iteration. However, I also have tasks that need to run much faster.
I've read about the producer-consumer architecture, but since I plan to expand the project with features like MQTT communication and reading parameters from a CSV file, I’m unsure if it’s the best approach in the long run.
What would be a good strategy to handle thermocouple measurements efficiently without creating a bottleneck for the rest of the system? Any suggestions would be greatly appreciated!
Thanks!
02-14-2025 07:01 AM
Hi Bonapg,
@Bonapg wrote:
What would be a good strategy to handle thermocouple measurements efficiently without creating a bottleneck for the rest of the system? Any suggestions would be greatly appreciated!
A generic advice is to put each task into its own loop.
This also applies to your other stuff , like MQTT (network communication) or data saving (file handling).
You could use a QMH structure to coordinate communication between loops/tasks…
02-14-2025 07:07 AM
Thank you very much for your suggestion! But to connect those while loops should I use channel wires?
02-14-2025 07:36 AM - edited 02-14-2025 07:36 AM
Hi Bonapg,
@Bonapg wrote:
But to connect those while loops should I use channel wires?
That would be a CMH (channel message handler) as advocated by Bob Schor!
The "older" QMH uses queues instead…
02-14-2025 04:38 PM
I would suggest learning about the DQMH framework.
That's an extension beyond the basic QMH within labview.
I'm using it now to spawn off concurrent high speed data handling, user input dialog boxes etc.
02-16-2025 09:18 AM
Hi Bonapg,
Dealing with data that is sampled at different rates makes logging and analysis difficult.
NI was aware of this and gave us a way to "oversample" modules like the NI-9213.
You must use a multi-slot chassis to access this DAQmx feature.
Sampling Higher Than Specified Maximum Rate with Slow Sampled C Series Modules