# ToEngUnits()

Converts an integer count value to an equivalent single precision voltage (or current) value. This method is typically used to obtain a voltage value from data received from an A/D with methods such as AIn().

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function ToEngUnits(ByVal range As MccDaq.Range, ByVal dataVal As Short, ByRef engUnits As Single) As MccDaq.ErrorInfo

Public Function ToEngUnits(ByVal range As MccDaq.Range, ByVal dataVal As System.UInt16, ByRef engUnits As Single) As MccDaq.ErrorInfo

C# .NET

Public MccDaq.ErrorInfo ToEngUnits(MccDaq.Range range, ushort dataVal, out float engUnits)

Public MccDaq.ErrorInfo ToEngUnits(MccDaq.Range range, short dataVal, out float engUnits)

## Parameters

range

Voltage (or current) range to use for the conversion to engineering units. When using this method 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 method. Refer to board-specific information for a list of valid range settings.

dataVal

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

engUnits

The single precision voltage (or current) value that is equivalent to dataVal is returned to this variable. The value will be within the range specified by the range parameter.

## Returns

- An ErrorInfo object that indicates the status of the operation.
- engUnits – the engineering units value equivalent to dataVal is returned to this variable.

## Notes

- This method is not supported for hardware with resolution greater than 16 bits.
- The default resolution of this method is 12 bits, so if the device has neither analog input nor analog output, the result will be a 12 bit conversion.
- If the device has both analog input and analog output, the resolution and transfer function of the D/A converter on the device is used.