Example Code

Pitot Static Tube Pressure Calculations with DAQmx Acquisition

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Download All

Overview

This example shows how to read two channels of pressure data from a Pitot Static Tube and calculate the free stream velocity. The acquired and calculated data is then displayed on the User Interface in graph format.

Description

The code displayed uses the standard DAQmx low level functions to acquire data and display it on the user interface.

The calculation part of the code firstly converts the voltage signal acquired into standard pressure units, Pa, for further calculations. The equation used is just a standard function, but it may vary according to the sensor type, refer to manufacturer specifications.

Pressure = (Max Pressure/Input voltage)*(Measured Voltage/Calibration factor)

The second part of the calculation refers to the instrument used for pressure data acquisition, in this case a pitot static tube has been chosen. Two pressure readings are taken from the pitot static tube and then an equation derived from the Bernoulli’s equation is used to calculate the velocity of the free stream.

The derived equation: U, velocity = √((2/ρ)(Pt-Ps))

All calculations are done in Pascal's, 1 PSI = 6894.75 Pa

Pitot Tube.png

Requirements

Software

  • LabVIEW 2010 or compatible
  • DAQmx 9.1.5 or compatible

Hardware

  • Most NI DAQ hardware.  Will likely need signal conditioning for transducer signal.
  • Pressure Transducer
  • Pitot Static Tube

Steps to Implement or Execute Code

1) Select the static pressure channel and total pressure channels that correspond with the DAQmx device, static pressure and total pressure, output channels.

2) On the front panel state the rate of acquisition desired and how many samples to acquire.

3) For the calculation part of the VI, define the supply voltage, calibration factor, the maximum measurable pressure in PSI and the density of the fluid.

(Some of the user defined values may be constant depending on the application, so the control may be replaced with constants accordingly.)

4) Run the VI.                   

5) Press the stop button on the User Interface to halt the execution of the VI.

Block Diagram Steps


1) Create the DAQmx channels as analogue inputs, to acquire the pressure data from the sensors in the form of a voltage reading.

2) Set the task to continuously sample the data at a user specified sampling rate and choose how many samples of data to take.

3) Start the DAQmx tasks on both channels.

4) Read the data, multiple samples from one channel, then convert the acquired voltage signal to pressure units (Pa) using a manufacturer specified conversion equation and display the values as a waveform on the front panel, with respect to time.

5) Calculate the velocity of the free stream of the Pitot Static tube, using a function derived from the Bernoulli equation.

The conversion and calculation takes place within the Sub VI.

6) Create a XY graph, using the Build XY Graph express VI, to display the velocity data as a function of the total pressure.

7) Detect whether the stop button has been pressed or if an error has occurred, if either is true then the VI will stop.

😎 Clear the DAQmx tasks for both channels.

9) Handle the errors and inform the user if an error has occurred with an indicator on the front panel.

I/O Connections Overview:

Make sure the physical Channels defined in the VI are correct, according to the modules on the DAQmx hardware.

Additional Information or References

Block Diagram:

Main VI:

Main Pitot code.png

Sub VI:

SubVI pitot calcs.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

Stephanie L
Applications Engineer
National Instruments UK and Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors