Example Code

Load Cell Data Acquisition with Null Offset and Shunt Calibration

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

Overview
This example shows how to acquire load cell data, along with performing null offset and shunt calibration if desired.

Description:
This VI, combined with the NI 9237, is designed to be an out of the box solution to acquire load cell data. Minimal inputs are required (Physical Channels, Excitation Value, mV/V, and Max Weight) for operation, while functionality for Offset Nulling and Shunt Calibration can be enabled or disabled as desired. Enabling Offset Nulling will account for any offset before starting acquisition, essentially making your initial value zero. (Please have the load cell at an idle (resting) state before starting the VI). Enabling Shunt Calibration will connect the internal 100k resistor of the NI 9237 to the load cell, therefore obtaining an even more accurate reading. (Note: When Shunt Calibration is enabled, please fill in the values for 'Shunt Calibration Parameters' appropriately).
Note: It is assumed that the load cell type is full-bridge completion.
Note: Although the 9237 can use external excitation for the load cell, this example uses internal excitation. Excitation options for the NI 9237 are 2.5V, 3.3V, 5V, and 10V. Max excitation power is 150mW.
Note: This was designed for the NI 9237, using NI-DAQmx 8.7.1. NI-DAQmx 8.7.1 or above is required, as the example program attached uses VI's which are not present before 8.7.1.
**The accompanying code represents a very specific use case for NI products. For more general examples, please refer to ni.com/examples, the LabVIEW Example Finder, or the NI driver help files that come with every NI driver.

Steps to implement or execute code
To implement this example:
  1. Define the Physical channels to be used
  2. (optional) Set the rest of the parameters as needed
  3. Run the VI
  4. (Optional) Turn on the Highlight Execution to see the flow of the VI


To execute this example:

  1. Install the required software.
  2. Connect the DAQ hardware that supports Analog Input features
  3. Confirm the connection with the MAX with TestPanel
  4. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 16.0 or compatible

Hardware
cDAQ with C series Analog Input Module

 

fp.JPG

 

bd.JPG

 

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

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