Chapter 2 Function Reference — WFM_Scale
NI-DAQ FRM for PC Compatibles 2-440
©
National Instruments Corporation
range, NI-DAQ sets the voltage to the maximum or minimum value and returns an error.
NI-DAQ still completes the translation, however.
Range: Any real number that produces a voltage within the analog output range.
voltArray is the input array of double-precision values that represents the voltages NI-DAQ
is to produce at one of the outputs.
Range: Any real number that produces a voltage within the analog output range.
binArray is the array of binary values converted from the voltages contained in voltArray.
The values in binArray produce the original voltages when NI-DAQ writes them to a DAC
on your device. Refer to Appendix B, Analog Input Channel, Gain Settings, and
Voltage Calculation, for the calculation of binary value.
Using This Function
WFM_Scale calculates each binary value using the following formulas:
• Unipolar configuration:
12-bit DACs: binVal = voltage * (gain * (4,096/outputRange)).
16-bit DACs: binVal = voltage * (gain * (65,536/outputRange)).
• Bipolar configuration:
12-bit DACs: binVal = voltage * (gain * (2,048/outputRange)).
16-bit DACs: binVal = voltage * (gain * (32,768/outputRange)).
18-bit DACs: binVal = voltage * (gain * (131,072/outputRange)).
The DSA devices use 32-bit data buffers. If you are using C or Delphi, you will need to
typecast your i32 array to i16 when you call
WFM_Scale
. If you are using Visual Basic, you
should use the
nidaqr32.bas
file (instead of
nidaq32.bas
) to relax type checking on
binArray. Each 18-bit binVal is shifted into the upper 18 bits of the array element.