Pepper Computer RS232, RS485 user manual SMDAC1PutV Syntax, RetVal = SMDAC1PutV0, 1, 0x0FFF

Models: RS485 RS232

1 320
Download 320 pages 36.43 Kb
Page 275
Image 275

Chapter 5 Analog Modules

SMART I/O User’s Manual

 

 

 

 

 

 

 

 

 

 

5.5.8.7 SMDAC1PutV

Syntax

error_code SMDAC1PutV(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 u_int8 Channel

int16 Value

Output

error_code

Example

SM-Port number to be accessed

Number of the DAC output channel to access (0-5)

Value to be written

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

5

RetVal = SMDAC1PutV(0, 1, 0x0FFF);

 

 

 

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

- 119

 

 

 

 

 

 

 

 

 

 

 

 

Page 275
Image 275
Pepper Computer RS232, RS485 user manual SMDAC1PutV Syntax, RetVal = SMDAC1PutV0, 1, 0x0FFF