# AConvertData()

Converts the raw data collected by AInScan() into 12-bit A/D values. The AInScan() method can return either raw A/D data or converted data, depending on whether or not the ConvertData option is used. For many 12-bit A/D boards, the raw data is a 16-bit value that contains a 12-bit A/D value and a 4-bit channel tag (refer to board-specific information in the Universal Library User's Guide). The data returned to adData consists of just the 12-bit A/D value. The data returned to chanTags consists of just the channel numbers.

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function AConvertData(ByVal numPoints As Integer, ByVal adData As Short(), ByVal chanTags As Short()) As MccDaq.ErrorInfo

Public Function AConvertData(ByVal numPoints As Integer, ByVal adData As System.UInt16(), ByVal chanTags As System.UInt16()) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo AConvertData(int numPoints, short[] adData, short[] chanTags)

public MccDaq.ErrorInfo AConvertData(int numPoints, ushort[] adData, ushort[] chanTags)

##### Deprecated methods

The following methods are deprecated, and should only be used for legacy applications. The methods above are preferred, and must be used for 64-bit application development.

VB .NET

Public Function AConvertData(ByVal numPoints As Integer, ByRef adData As Short, ByRef chanTags As Short) As MccDaq.ErrorInfo

Public Function AConvertData(ByVal numPoints As Integer, ByRef adData As System.UInt16, ByRef chanTags As System.UInt16) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo AConvertData(int numPoints, ref ushort adData, out ushort chanTags)

public MccDaq.ErrorInfo AConvertData(int numPoints, ref short adData, out short chanTags)

## Parameters

numPoints

Number of samples to convert

adData

Reference to start of data array

chanTags

Reference to start of channel tag array

## Returns

- An ErrorInfo object that indicates the status of the operation.
- adData - converted data
- chanTags - channel tags, if available

## Notes

- When collecting data using AInScan() without the ConvertData option, use this method to convert the data after it has been collected. There are cases where the ConvertData option is not allowed. For example - if you are using both the DmaIo and Background option with AInScan() on some devices, the ConvertData option is not allowed. In those cases, this method should be used to convert the data after the data collection is complete.
- For some boards, each raw data point consists of a 12-bit A/D value with a 4-bit channel number. This method pulls each data point apart and puts the A/D value into the adData array and the channel number into the chanTags array.
- 12-bit A/D boards: The name of the array must match that used in AInScan(). Upon returning from AConvertData(), the adData array contains only 12-bit A/D data.