Enable ADCsEnables one or more of the unmapped ADC channels.
|
Device Compatibility
|
ADC Map (Enabled) is the bitmap of ADC channels to enable:
|
|||||||||||||||||
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. | |||||||||||||||||
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:
|
|||||||||||||||||
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. | |||||||||||||||||
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.
|
Using This VI
The Enable ADCs VI enables one or more independent ADC channels for use as general-purpose analog inputs. The controller returns an error if you attempt to enable or disable an ADC being used as an axis feedback when the axis is enabled. These feedback channels are automatically enabled/disabled when you enable or disable their corresponding axis with the Enable Axes VI. You must first disable the axis using analog feedback, then enable or disable ADCs.
The NI-Motion Analog-to-Digital Converter (ADC) multiplexes between channels with a scan rate of approximately 40 µs per channel for the 7340 motion controller, and 25 µs per channel for the 7350 motion controller. Therefore, the time between samples for a specific ADC channel is as follows:
7330/40: ADC sample time = 40 µs/channel × (number of enabled channels)
7350:
ADC sample time = 25 µs/channel × (number of enabled channels)
By default, all channels are enabled at power-up. You must disable unused channels to increase the scan rate and decrease the sample time.
The 40 µs/channel scan rate is fast enough to support analog feedback at the fastest PID update rates as long as no additional ADC channels are enabled.
Example
To enable ADC channels 1, 3, 5, and 7 on the 7350 motion controller, call the Enable ADCs VI with AxisMap, as follows.
0 (ADC 1) | 1 (ADC 2) | 2 (ADC 3) | 3 (ADC 4) | 4 (ADC 5) | 5 (ADC 6) | 6 (ADC 7) | 7 (ADC 8) |
True | False | True | False | True | False | True | False |
Under normal conditions, because ADC channels 2, 4, 6, and 8 are set to False, they are disabled when you execute this VI. However, if ADC channel 2 is already being used as feedback for axis 2, the disable for ADC 2 is ignored, resulting in a modal error and the following enabled ADCs bitmap.
0 (ADC 1) | 1 (ADC 2) | 2 (ADC 3) | 3 (ADC 4) | 4 (ADC 5) | 5 (ADC 6) | 6 (ADC 7) | 7 (ADC 8) |
True | True | True | False | True | False | True | False |
In this example there are five ADCs enabled, so the sample time for each ADC channel is as follows:
ADC sample time = 40 µs/channel × 5 = 200 µs
The ADC sample time puts a limit on the fastest PID update rate practically achievable. You can set a faster PID update rate with the Enable Axes VI, but the PID loop does not truly operate at that faster rate because the ADC channels used as feedback are not being sampled fast enough.