Converting Voltage Values to Binary Values for the NI 9264 (FPGA Interface)

CompactRIO

Converting Voltage Values to Binary Values for the NI 9264 (FPGA Interface)

Set the Calibration Mode to Calibrated in the C Series Module Properties dialog box for the NI 9264 if you want the FPGA I/O Node to accept fixed-point data in units of volts when writing to the module. If you set the Calibration Mode to Raw, the FPGA I/O Node accepts only binary values when writing to the module. You must convert output voltage values to binary values before you write them to the module. You must convert these values in the host VI.

Using a VI to Convert Voltage to Binary

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

 Open example

Using an Equation to Convert Voltage to Binary

You can use the following equation in the host VI to convert the analog output values to binary values:

Binary Value = (Voltage Value × 109Offset) ÷ LSB Weight,

where Binary Value is the value you write to the FPGA I/O Node
Voltage Value is the voltage in V that you want the channel to output
Offset is the value returned by the Offset property
LSB Weight is the value returned by the LSB Weight property.

National Instruments recommends using calibrated values for analog output. To convert calibrated voltage values, 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 uncalibrated voltage values by using the following values for Offset and LSB Weight:

Offset = 0

LSB Weight = 21 V ÷ 2DAC Resolution × 109

where DAC Resolution is the DAC resolution value in the NI 9264 Operating Instructions and Specifications.