Chapter 5 Analog Modules

SMART I/O User’s Manual

 

 

 

 

 

 

 

 

 

 

5.4.8.4 SMADC1GetV

Syntax

error_code SMADC1GetV(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 performed and the result stored as a signed integer value.

Input

u_int8 PortNr u_int8 Channel

int16 *pValue

Output

error_code

Example

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

SUCCESS

if module was not initialised

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).

5

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

 

 

Value (16-bit HEX)

 

Unipola

r

 

 

Bipolar

 

Positive Full-Scale

$0FFF

Positive Full-Scale

$07FF

+1LSB

$0001

+1LSB

$0001

0

 

 

$0000

0

$0000

 

 

 

 

-1LSB

$FFFF

 

 

 

 

Negative Full-Scale

$F800

 

 

 

 

October 01, 1996

©1996 PEP Modular Computers GmbH

Page 5 - 97

 

 

Page 253
Image 253
Pepper Computer RS232, RS485 user manual SMADC1GetV Syntax, RetVal = SMADC1GetV0, 2, 0x07FF