LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle low sample rate from NI-9213 not bottleneck my other tasks

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!

0 Kudos
Message 1 of 6
(228 Views)

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…

Best regards,
GerdW


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

Thank you very much for your suggestion! But to connect those while loops should I use channel wires?

0 Kudos
Message 3 of 6
(215 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(197 Views)

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.

0 Kudos
Message 5 of 6
(170 Views)

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 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 6
(131 Views)