SMART I/O User’s Manual

Chapter 5 Analog Modules

 

 

 

 

 

 

 

 

 

 

5.1.8.5 SMDAD1GetV

Syntax

error_code SMDAD1GetV(u_int8 PortNr, u_int8 Channel, int16 *pValue);

Description

This function fetches the conversion result of a selected channel. A gain and offset correction is done with the use of the selected conversion table. 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

SM-Port to be accessed

Number of the ADC input channel to access (0-3)

Pointer to the location where the conversion result will be stored

error_code

Example

SUCCESS

if module was not initialized

E_SEEK

E-BMODE

if the module is unknown

or standard OS-9 error code (refer to the OS-9 Technical Manual Error Codes Section).

RetVal = SMDAD1GetV(0, 2, 0x07FF);

 

 

 

 

 

 

Value (16-bit HEX)

 

 

 

 

 

 

Unipola

r

 

 

Bipolar

 

 

 

 

 

Positive Full-Scale

$07FF

Positive Full-Scale

$07FF

 

 

 

 

 

+1LSB

$0001

+1LSB

$0001

 

 

 

 

0

 

 

$0000

-1LSB

$FFFF

 

 

 

 

 

 

 

 

Negative Full-Scale

$F800

 

Page

5 - 20

 

©1996 PEP Modular Computers GmbH

 

March 12, 1996

 

 

 

 

 

 

 

 

 

 

Page 176
Image 176
Pepper Computer RS485, RS232 user manual SMDAD1GetV Syntax, RetVal = SMDAD1GetV0, 2, 0x07FF