cbFromEngUnits()

Converts a single precision voltage (or current) value in engineering units to an integer count value. This function is typically used to obtain a data value from a voltage value for output to a D/A with functions such as cbAOut().

Function Prototype

C/C++

int cbFromEngUnits(int BoardNum, int Range, float EngUnits, unsigned short *DataVal)

Visual Basic

Function cbFromEngUnits(ByVal BoardNum&, ByVal Range&, ByVal EngUnits!, DataVal%) 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 in the conversion. BoardNum may be 0 to 99.

Range

The voltage (or current) range to use for the conversion to counts. When using this function to obtain a value to send to a D/A board, keep in mind that some D/A 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.

EngUnits

The single precision voltage (or current) value to use for the conversion to counts. Set the value to be within the range specified by the Range argument.

DataVal

The function returns an integer count to this variable that is equivalent to the EngUnits argument using the resolution of the D/A on the board referenced by BoardNum (if any).

Returns

Notes