SMART I/O User's Manual
5.3.8.12 SMADCSetGain
Syntax
error_code SMADCSetGain(u_int8 PortNr, u_int8 channel,
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
Example
RetVal = SMADCSetGain(0, 1, 2);
Page 5 - 78
u_int8 gain);
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
If wrong type of module or no module
E_MNF
is fitted on the selected port
If wrong channel number is specified
E_PARAM
Illegal gain value
E_BMODE
or standard OS-9 error code (refer to the OS-9
Technical Manual Error Codes Section).
©1996 PEP Modular Computers GmbH
Chapter 5 Analog Modules
{gain of 4}
March 12, 1996
Need help?
Do you have a question about the Modular Computers RS485 and is the answer not in the manual?