Adc Objects

Introduction  

 

An Adc object manages a single analog-to-digital converter on an XMP motion controller. The XMP controller supports 8 channels (0 to 7) of 16 bit analog-to-digital conversions.

To configure the voltage range for an analog input, use the method mpiAdcConfigSet(MPIAdc adc, MPIAdcConfig *config, void *external), where adc is a handle to an MPIAdc object, and config is a pointer to a MPIAdcConfig structure. The MPIAdcConfig structure contains a "range" element, which specifies the analog input's voltage range. The XMP controller supports voltage ranges of 10.0V, 5.0V, 2.5V, or 1.25V volt ranges (all ranges are bipolar). Set the MPIAdcConfig range to one of the following values:

 
Bipolar Voltage Range (+/- V)
10.0
5.0
2.5
1.25
 

To use the ADC, first create an ADC object using mpiAdcCreate(MPIControl control, long number), where control is a handle to an MPIControl object and number is the analog-to-digital converter channel number.

The number of ADCs on the controller can be configured using the method mpiControlConfigSet(MPIControl control, MPIControlConfig *config, void *external). The MPIControlConfig structure contains an element called adcCount, which is used to specify the number of analog-to-digital converter channels. The default setting is for eight (8) axes.

After the ADC has been configured, to read a channel use the method mpiAdc Input(MPIAdc adc, unsigned long *input), where adc is a handle to an MPIAdc object, and input is a pointer to the digitally converted value.

Methods
Create, Delete, Validate Methods
  mpiAdcCreate Create Adc object
  mpiAdcDelete Delete Adc object
  mpiAdcValidate Validate Adc object
     
Configuration and Information Methods
  mpiAdcConfigGet Get Adc configuration
  mpiAdcConfigSet Set Adc configuration
  mpiAdcFlashConfigGet Get Adc flash config
  mpiAdcFlashConfigSet Set Adc flash config
     
Action Methods
  mpiAdcInput Read input level
     
Memory Methods
  mpiAdcMemory Set address to Adc memory
  mpiAdcMemoryGet Copy Adc memory to application memory
  mpiAdcMemorySet Copy application memory to Adc memory
     
Relational Methods
  mpiAdcControl Return handle of Control object associated with Adc
  mpiAdcMotorMapGet Get the object map and write it into the structure pointed to by map
  mpiAdcNumber Get index of Adc
     

Data Types
  MPIAdcConfig / MEIAdcConfig  
  MPIAdcMessage  
  MEIAdcMux