Set ADC Range

NI-Motion VI

Set ADC Range

Sets the voltage range for the analog to digital converters, on a per-channel basis.

Details

Device Compatibility

DeviceCompatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
N
NI SoftMotion Controller for CANopen—Accelnet
N
NI SoftMotion Controller for CANopen—Xenus
N
Range (–10 to +10) specifies the input voltage range over which the ADC converts input voltages to digital values. Voltages outside of the range clamps at the extremes, which are –2048 or +2047 (7330/40) and –32,768 to +32,767 (7350) for the –5 to +5 V and –10 to +10 V ranges, and 0 to 4,096 (7330/40) and 0 to +65,535 (7350) for the 0 to +5 V and 0 to +10 V ranges. You can choose from the following values for the range:
Binary Values
Range Values 7350 7330/40
0 to 5  0 to +65,535
0 to +4,095
–5 to +5  –32,768 to +32,767
–2,048 to +2,047
0 to +10  0 to +65,535
0 to +4,095
–10 to +10 (default)  –32,768 to +32,767 –2,048 to +2,047
Board ID is a unique number assigned by Measurement & Automation Explorer (MAX) used to send and receive commands and data to or from a specific NI motion controller.
ADC is the analog-to-digital converter channel to configure. Valid ADC resources are 0x51 through 0x5F.
error in (no error) describes error conditions that occur before this VI runs. The default input of this cluster is no error. If an error already occurred, this VI returns the value of error in in error out. The VI runs normally only if no incoming error exists. Otherwise, the VI passes the error in value to error out. The error in cluster contains the following parameters:
status is TRUE if an error occurred before this VI was called, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.
Bd ID Out is provided for flow control. You can string together NI-Motion VIs by wiring the Bd ID Out terminal of one VI to the Board ID terminal of the next VI.
Resource Output is the Axis, Vector Space, ADC, or Encoder you wired into the VI. Use Resource Output to pass the resource to another VI and/or to display information about the device.
error out contains error information. If error in indicates an error, error out contains the same error information. Otherwise, it describes the error status that this VI produces.
status is TRUE if an error occurred, or FALSE if not. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code.
code is a number identifying an error or warning. If status is TRUE, code is a nonzero error code. If status is FALSE, code is zero or a warning code. Use the error handler VIs to look up the meaning of this code and display the corresponding error message.
source is a string that indicates the origin of the error, if any. Typically, source is the name of the VI in which the error occurred.

Using This VI

If you do not call this VI, the range defaults to –10 to +10 V. If you know that the input voltage falls within a more restrictive range, you can effectively increase the resolution of the measurements by selecting an appropriate range from the previous list.

Note  With the 7350 motion controller, changing the range of an ADC changes all other ADCs to the same range. Other NI motion controllers can set the range independent of other ADCs.

For example, if you are using a 7340 motion controller, the input signal ranges from –3 to +3 V, and you select the –5 to +5 V range, the 4,096 discrete values for the ADC are 2.44 mV apart instead of the 4.88 mV apart when using the –10 to +10 V range. If you are using a 7350 motion controller, the input signal ranges from –3 to +3 V, and you select the –5 to +5 V range, the 65,536 discrete values for the ADC are 152 µV apart instead of the 305 µV apart when using the –10 to +10 V range.

ADC ranges cannot be changed on any ADC while an axis that is using analog feedback is enabled. You must first disable the axis using analog feedback, then change the range.

For more information, refer to the Read ADCs and Enable ADCs VIs.