Pepper Computer RS485, RS232 user manual SMADCSetGain Syntax

Models: RS485 RS232

1 320
Download 320 pages 36.43 Kb
Page 234
Image 234

SMART I/O User’s Manual

Chapter 5 Analog Modules

 

 

 

 

 

 

 

 

 

 

5.3.8.12SMADCSetGain

Syntax

error_code SMADCSetGain(u_int8 PortNr, u_int8 channel, u_int8 gain);

Description

This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid and sets the value of the gain amplifier. The valid values for gain are defined in the file smadc.h. The default values for the attached sensor are substituted here when the sensor type is selected!

Input

u_int8 PortNr

u_int8 channel u_int8 gain

Output

error_code

Port number to set gain (from 0 to 10)

Number of specified channel (0 to 3)

Value of gain amplifier (0 to 7 for gain factors from 1 to 128)

SUCCESS

E_MNF If wrong type of module or no module is fitted on the selected port

E_PARAM If wrong channel number is specified E_BMODE Illegal gain value

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

Example

 

RetVal = SMADCSetGain(0, 1, 2);

{gain of 4}

 

 

 

 

Page

5 - 78

©1996 PEP Modular Computers GmbH

March 12, 1996

 

 

 

Page 234
Image 234
Pepper Computer RS485, RS232 user manual SMADCSetGain Syntax