Example Code

Force Pressure Bridge w AutoScaling

Code and Documents

Attachment

About this Application:


This application is designed to make measurements with an NI-9237 very easy and quick. It has the ability to scale the data being acquired on execution and provides flexibility with how you would like to achieve this scaling. The following picture shows the front panel for this application:

mainfront.png

As can be seen from the above image the main settings that specify bridge type and excitation are found here. You can also select whether to perform offset nulling or shunt calibration. If you wish to set up a new scale you can simply press the “Calibrate?” button and hit run. This will open a new dialogue box like the one below:

scalefront.png

This dialogue box allows for the comparison between electrical values and physical values which will log the new scale to file. There are 3 different scaling types:

Linear

Map Range

Table

The block diagram code for this scaling subVI consists of a large case structure which is selected by the tab control that allows you to see the different scale types. An example of some of the code can be seen in the block diagram picture below:

DAQ.png

After the scaling settings have been applied the user is returned to the main front panel in which they will see their acquisition happening live in the graph. This data is logged to file for later use.

mainfrontrun.png

Operating Instructions:


In order to use this VI please follow the instructions as in these following steps:

  1. Open the project file named "Project.lvproj" which will present you with a project window which contains all of the VIs and calibration and log files that are generated when you run the Force/Pressure Bridge front panels.
  2. Open "Force Bridge Front Panel.vi" or "Pressure Bridge Front Panel.vi" which will present you with a front panel ready for your experiments.
  3. Press the LabVIEW execution button which will start the application running.
  4. Set up the configuration which your experiment requires and make sure to set the correct device address.
  5. You MUST select either to load a calibration file from a location on your hard drive or press the "Calibrate?" button to create a new calibration.
  6. When you are happy with the settings please press the "Run" button and this will start the execution of your DAQ system.
  7. If you chose to calibrate you will see a calibration window pop up where you can choose the calibrate using "Linear", "Map Ranges" or "Table Method". When calibrating make sure to provide the maximum and minimum scaled values which your experiment is going to use as this is used by the DAQmx VIs to set up the scaling. By pressing the "Record" buttons you will populate the voltage value boxes.
  8. When  you are happy with the calibration press the "Accept" button and this will bring you back to the main front panel.
  9. Your front panel will now show the readings on a graph and log these to a binary file for use at a later date.

  10. When you are done with the experiment press the "Stop" button to close the application.

Note:


This Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at:

http://ni.com/samplecodelicense


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

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

Comments
KevinPn
Member
Member
on

Is there a version of this that would write the log files to a spreadsheet? Thank you

Contributors