# cbToEngUnits32()

Converts an integer count value to an equivalent double precision voltage (or current) value.

## Function Prototype

C/C++

int cbToEngUnits32(int BoardNum, int Gain, unsigned long DataValue, double *EngUnits);

Visual Basic

Function cbToEngUnits32(ByVal BoardNum&, ByVal Gain&, ByVal DataValue&, EngUnits#) As Long

## Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice().This function uses the board number to determine the resolution and polarity values to use for the conversion. BoardNum may be 0 to 99.

Gain

Voltage (or current) range to convert to engineering units. When using this function to obtain engineering units from a value received from an A/D board, keep in mind that some A/D boards have programmable voltage ranges, and others set the voltage range via switches on the board. In either case, the desired range must be passed to this function.

Refer to board-specific information in the Universal Library User's Guide for a list of the supported A/D ranges of each board.

DataValue

An integer count value (typically, one returned from an A/D board) to convert to engineering units.

EngUnits

The double precision voltage (or current) value that is equivalent to DataValue is returned to this variable. The value will be within the range specified by the Range argument using the resolution of the A/D on the board referenced by BoardNum (if any).

## Returns

- Error code or 0 if no errors.
- EngUnits – the engineering units value equivalent to DataValue is returned to this variable.

## Notes

- This function is typically used to obtain a voltage (or current) value from data received from an A/D with functions such as cbAIn32().
- This function should be used for devices with a resolution of 20-bits or more.
- The default resolution of this function is 32 bits, so if the device referenced by BoardNum has neither analog input nor analog output, the result will be a 32 bit conversion.
- If the device referenced by BoardNum has both analog input and analog output, the resolution and transfer function of the A/D converter on the device is used.