7 smdad1putv, 7 smdad1putv -22, Smart i/o user’s manual – Pepper Computer Modular Computers RS485 User Manual

Page 178: Chapter 5 analog modules

Advertising
background image

SMART I/O User’s Manual

March 12, 1996

©1996 PEP Modular Computers GmbH

Page 5 - 22

Chapter 5 Analog Modules

5.1.8.7 SMDAD1PutV

Syntax

error_code SMDAD1PutV(u_int8 PortNr, u_int8 Channel,

int16 Value);

Description

This function sets the selected DAC channel to the chosen value. A gain and

offset correction is performed with the use of the automatically selected

conversion table depending whether a user-defined table has been specified

or not. Hence, if a user-defined table exists then this will be used, otherwise

the default factory set table will be used.

Input

u_int8 PortNr

SM-Port number to be accessed

u_int8 Channel

Number of the DAC output channel to access

(0-1)

int16 Value

Value to be written

Output

error_code

SUCCESS

E_SEEK

if module was not initialized

E-BMODE

if the module is unknown

or standard OS-9 error code (refer to the OS-9

Technical Manual Error Codes Section).

Example

RetVal = SMDAD1PutV(0, 1, 0x7FF);

Value (16-bit HEX)

Unipolar

Bipolar

Positive Full-Scale

$0FFF

Positive Full-Scale

$07FF

+1LSB

$0001

+1LSB

$0001

0

$0000

0

$0000

-1LSB

$FFFF

Negative Full-Scale

$F800

Advertising
This manual is related to the following products: