LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous integration of airflow signal doesn't display properly.

Hello everyone!

 

I apologise if I have not posted this question in the right area. I have attempted to build an application that continuously integrates an airflow signal to document changes in lung volume. I can successfully acquire the airflow signal, apply specific correction factors depending on the polarity of the signal (in order to correct for the difference in gas temperature and humidity between inspired and expired gas volumes. i.e., BTPS correction factor). The overall aim of the application is to provide visual feed-back of an individuals tidal volume signal, in addition to an asynchronous metronome, in order to mimic specific breathing patterns. I have set the 'point-by-point' integral vi to reset after each inspiration (detected as a negative zero-crossing) to remove any 'volume-drift'.

 

Unfortunately, the dynamic integration of the airflow signal doesn't produce a smooth volume signal. I have attached a screen shot of the volume-time signal (and the *.vi of the application) for your perusal. Is it possible that the processing of the while-loop takes too long and, by the time the while-loop performs another iteration, it misses some data from the flow-signal, thus producing the 'step-like' pattern in the volume signal. Moreover, when I reduce the sample rate from 200Hz to 30Hz, the integrated volume curve looks smoother.

 

I have tried using producer/consumer designs to queue the acquired data, and subsequently process it in a consumer loop for display, but that seemed to slow things down quite a bit (although I was probably doing it wrong! ha!).

 

As you can see by my VI, I am quite new to the labview programming world, and I would appreciate any advice that anyone can provide.

 

Thank you all! Cheers!

Download All
0 Kudos
Message 1 of 2
(2,678 Views)

The sample rate you specify is meaningless. Your DAQmx Read is 1Chan 1Samp. Set it for NSamp and then you will be acquiring using the hardware clock and getting multiple samples at a consistent rate.

 

With the amount of processing, you might still need to move to a producer/consumer desing pattern so that you do not get an error about samples no longer available.

0 Kudos
Message 2 of 2
(2,670 Views)