
Chapter 5 Analog Modules  | SMART I/O User’s Manual  | |||
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
5.1.8.4 SMDAD1GetVRaw
Syntax
error_code SMDAD1GetVRaw(u_int8 PortNr, u_int8 Channel, int16 *pValue);
Description
This function fetches the conversion result of a selected channel without performing a gain or offset correction. The result is always a signed integer value. If bipolar mode is selected, the function returns the 2’s complement value of the original read.
Input
u_int8 PortNr u_int8 Channel
int16 *pValue
Output
Number of the ADC input channel to access 
Pointer to the location where the conversion result will be stored
5
error_code
Example
SUCCESS  | if module was not initialized  | 
E_SEEK  | |
if the module is unknown  | 
or standard 
RetVal = SMDAD1GetVRaw(0, 2, 0x07FF);
  | 
  | 
  | Value  | 
  | 
  | 
  | 
  | 
  | 
  | ||
  | Unipola | r  | 
  | 
  | Bipolar | 
  | 
  | 
  | 
  | 
  | 
  | 
  | Positive   | $07FF  | Positive   | $07FF  | 
  | ||||||
  | +1LSB  | $0001  | +1LSB  | $0001  | 
  | 
  | 
  | 
  | |||
  | 0  | 
  | 
  | $0000  | $FFFF  | ||||||
  | 
  | 
  | 
  | 
  | Negative   | $F800  | |||||
March 12, 1996  | ©1996 PEP Modular Computers GmbH  | 
  | 
  | Page 5 - 19  | 
  | 
  | |||||
  | 
  | ||||||||||
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | 
  | ||