LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous Square Wave Pulse Tracking within Sample Loop

I am using a NI 6035e in an engine lab to sample signals from fuel flow and torque meters.  The torque meter requires high speed sampling (10kHz+) while the flow meter is an extremely low frequency digital signal from an open-collector, positive displacement meter (one pulse cycle corresponds with 1/1000L).

 

Currently, I have a DAQmx object recording 2500 samples per loop iteration and storing these samples in a rolling 10 second circular buffer.  This is required because, at extremely low fuel flow rates, it can be extremely difficult to capture a complete pulse cycle (pulse cycles can vary from tens of seconds in period to fractions of a second).  The issue is that this gives me a 10 second delay between what is on the screen and what is happening in the engine cell.  I would like to eliminate this issue, if at all possible.

 

Is there a way in LabVIEW to decouple the two loops and have the pulse frequency tracking done independently/asynchronously of the normal sample loop?  I would use a counter, but due to the location in which the flow meter is mounted, we occasionally measure spurious pulses caused by vibration that I have worked around by using a digital filter upstream of the pulse tracking circuit.

 

Ideally, I would have the torque signal capture running in one loop (independent), and be continuously measuring the fuel flow channel in another loop, where LabVIEW is timing the difference between two successive positive threshold crossings (signal goes from 0-5V, so perhaps a 2.5V threshold).  I just am not familiar enough with LabVIEW to understand how to "wire" this.  I could do it in regular code on a microprocessor, it's just the asynchronous "visual wiring" of LabVIEW that is tripping me up.

 

Hopefully that makes sense.  Any help would be most appreciated!

0 Kudos
Message 1 of 2
(2,672 Views)

Sounds like you want two acquisition loops, one for your fast torque meter samples and one for your slower pulse measurements. Feed the data from both into your display and/or logging loops on a queue (or a separate queue for each). This is a bit like the Continuous Measurement and Logging sample project, but with two acquisition loops.

 

From Labview splash screen, File>Create Project, Continuous Measurement and Logging will give the general architecture, and search for producer consumer and queued message handler design patterns for more info on the architecture.

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