From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

NI 9237 Example for Shunt Cal and Offset Cal

Code and Documents

Attachment

Shunt Calibration

Shunt calibration is a process used to obtain a gain adjust factor, which is used to correct for system gain error and discrepancies between nominal Gauge Factor and actual Gauge Factor of the strain gauge. The gain adjust factor is derived using theoretical (simulated) signal levels that should result from engaging a shunt resistor across one leg of a bridge sensor and the measured signal levels with the shunt resistor actually engaged.  Typically, the following formula is used to calculate the gain adjust factor:

The gain adjust factor is then multiplied by each future measurement to obtain highly accurate measurements that are adjusted for any gain errors or any discrepancies in the nominal Gauge Factor.

The calibration performed in this example takes three unique readings. The first is a normal analog reading of the system. The second reading is done with the Shunt Cal Enable I/O Property set to true. The last reading is done with the Offset Call Enable I/O Property set to true.

Note:You should perform an offset null compensation just before you perform a shunt calibration. Performing a shunt calibration before an offset null compensation causes improper gain adjustment because the offset signal voltage is compensated multiple times.

 

NI 9237 Shunt Calibration and Auto-Zero

This example program shows how the Shunt Cal Enable and Offset Cal Enable I/O Properties (Auto-Zero) of the NI 9237 can be used to calibrate a system. The system that this example calibrates for is a quarter bridge configured strain gauge system at rest.

The difference in the first two readings simulates a strain change by shunting one of the arms in the bridge with a precision 100 KOhm resistor. That change is read as a strain and compared to a theoretical calculation based on knowledge of the resistance of the strain gauges used. This test will indicate the effect of the resistance of the wires used to complete the bridge. The longer the external wires to the strain gauge, the greater the resistance. Such an increase in resistance can cause inaccuracies in strain readings. A normal % error should be less than 1%.

The difference in the first and last readings indicates how unbalanced the bridge is. The last reading, with the Offset Cal Enable I/O Property node set to true, returns a reading of the bridge perfectly balanced. It does this by internally disconnecting the external leads and shorting out the analog input channel. If the first reading of the unstrained system has a reading near the limit of the module, the system may move outside of the module’s range when it is loaded. The NI 9237 has a range of -25 mV/V to 25 mV/V.

This example requires LabVIEW 8.5, LabVIEW RT 8.5, LabVIEW FPGA  8.5 as well as the NI RIO 2.3 or 2.3.1 Driver.

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

Contributors