Showing results for 
Search instead for 
Did you mean: 

Sampling at two different sampling rates using NI cDAQ 9188 and NI 9215

Go to solution

Good day, LabView users!

I am trying to set up a LabView VI to collect data on multiple channels, across multiple cards/modules, at different sampling rates. Here's a brief summary of my application:

In order to understand the performance of a waste-heat recovery system, I am using a NI cDAQ 9188 chassis and several different cards (9215, 9213, and 9203) to monitor temperature, pressure, torque, and flow rates at various points on a testing stand. Because of the nature of the systems we test, I need to sample temperature, pressure, and flow rate at approximately 1 Hz. However, I also need to monitor the signal coming from a torque transducer at a much higher frequency (let's say 120 Hz for the sake of discussion).


Prior to setting up this test stand, I relied on LabView example VI's to set up/customize a VI which sampled all of my channels at the same rate. Now that I need to add a second independent sampling rate, I'm not sure how to modify the VI I have already created to do this. I am also not sure if modifying my existing VI is the best way to go about this. The VI I already have is attached. Can anyone provide any advice or resources to help me out?

0 Kudos
Message 1 of 3
Accepted by topic author meierdh

Good day, meierdh,


I took a look at the documentation for your cDAQ chassis, and it should have 3 analog input timing engines.  See this document for reference.


This should allow you to create up to three different analog input tasks, each with their own sampling rate.  In your case, two different tasks would likely solve the problem.  To set up the second task, place new DAQmx functions below your other ones, and link them with a new task wire.  These two tasks will operate in parallel, and can be configured with two different sampling rates. 


Additionally, if you need faster performance out of your program, you may want to look into changing your while loop into two while loops in a producer consumer configuration.  This guide walks through the producer consumer design pattern.


Give that a try, and please let us know if you have any more questions, or if this proposed change does not solve your issue.  Hope you had a wonderful holiday season, and happy coding.

Trevor H.
Technical Support Engineer
National Instruments
0 Kudos
Message 2 of 3

Hi,  can you change the code version to 2014?

0 Kudos
Message 3 of 3