Converting and Calibrating CompactRIO Analog Input Values (FPGA Interface)

CompactRIO

Converting and Calibrating CompactRIO Analog Input Values (FPGA Interface)

Set the Calibration Mode to Calibrated in the C Series Module Properties dialog box for an analog input module if you want the FPGA I/O Node to return calibrated, fixed-point data for the module. If you set the Calibration Mode to Raw, the FPGA I/O Node returns uncalibrated, binary values for the following analog input modules:

If you set the Calibration Mode to Raw, you must convert the binary values into meaningful engineering units and apply calibration constants to achieve more accurate results. You must convert and calibrate these values in the host VI.

Note Note  After you convert the binary values to engineering units for the NI 9217, you can also convert the nominal resistance values into temperature values.
Note Note  The binary data returned by the NI 9211, NI 9213, or NI 9219 is already calibrated. You must use different equations to convert values for the NI 9211, convert values for the NI 9213, or convert values for the NI 9219 into engineering units.

Using a VI to Convert and Calibrate Values

Refer to the Binary to Nominal VI in the labview\examples\CompactRIO\Basic IO\Analog Raw Host Calibration\AI Raw Host Calibration\AI Raw Host Calibration - cRIO.lvproj for an example of converting binary analog input values to calibrated engineering units. You can use the Binary to Nominal VI as a subVI in the host VI.

 Open example

For the NI 9205, you can also refer to the Binary to Nominal Polynomial (Host) VI in the labview\examples\CompactRIO\Module Specific\NI 9205\NI 9205 Linearization Coefficients\NI 9205 Linearization Coefficients.lvproj for an example of using the straight-line conversion algorithm along with the NI-MCal linearization correction to convert binary analog input values to calibrated engineering units. You can use the Binary to Nominal Polynomial (Host) VI as a subVI in the host VI.

 Open NI 9205 example

For the NI 9206, you can also refer to the Binary to Nominal Polynomial (Host) VI in the labview\examples\CompactRIO\Module Specific\NI 9206\NI 9206 Linearization Coefficients\NI 9206 Linearization Coefficients.lvproj for an example of using the straight-line conversion algorithm along with the NI-MCal linearization correction to convert binary analog input values to calibrated engineering units. You can use the Binary to Nominal Polynomial (Host) VI as a subVI in the host VI.

 Open NI 9206 example

Using an Equation to Convert and Calibrate Values

You can use the following equation in the host VI to convert binary analog input values to calibrated engineering units:

Input Engineering Units = (Binary Value × LSB WeightOffset)*

where Binary Value is the signed or unsigned value returned by the FPGA I/O Node
LSB Weight is the value returned by the LSB Weight property
Offset is the value returned by the Offset property.

The units of LSB Weight and Offset differ per module. Refer to the reference topic for the module you are using for the LSB Weight and Offset units. You can find the reference topic for the module by navigating on the Contents tab to FPGA Module»CompactRIO Reference and Procedures»Analog Input Modules»NI 9xxx.

To convert to calibrated engineering units, use the FPGA I/O Property Node to read the LSB Weight and Offset properties. If you do not want to read the LSB Weight and Offset values from the module, you can convert to uncalibrated engineering units by using the following values for Offset and LSB Weight:

Offset = 0

LSB Weight = Typical Input Span ÷ 2ADC Resolution 

where Typical Input Span is the value for the module in the table below
ADC Resolution is the ADC resolution value in the NI 9xxx Operating Instructions and Specifications for the module.
ModuleTypical Input Span
NI 920121.06 V
NI 9203 21.56 mA (unipolar), 43.12 mA (bipolar)
NI 920520.8 V
NI 920621.5 V
NI 921520.8 V
NI 92171000 Ω
NI 9221125 V
NI 9225850 V
NI 9229125.28 V
NI 923310.8 V
NI 923410.2 V
NI 923552.6 mV/V
NI 923652.6 mV/V
NI 923750 mV/V
NI 923921.04 V

*When converting and calibrating data acquired from the NI 9203 in ±20 mA range, the equation is:

Input Engineering Units = ((Binary Value – 32768) × LSB WeightOffset)

When calculating engineering units for the NI 9203 in ±20 mA range, Offset = 20 mA.