Pepper Computer Modular Computers RS232 User Manual

Page of 320
SMART I/O User’s Manual
©1996 PEP Modular Computers GmbH
March 12, 1996
Page 5 - 17
5
Chapter 5  Analog Modules
5.1.8.2 SMDAD1Init
Syntax
error_code SMDAD1Init(u_int8 PortNr);
Description
This function initializes the resources needed to use the SM-DAD1 on port
PortNr, including:
- testing of the SM-Module ID;
- reading the factory-set conversion table held in the EEPROM;
- setting the ADC to bipolar mode and the DAC to unipolar mode;
- fetching the resources.
Input
u_int8 PortNr
SM-Port number to initialize
(from 0 to 10)
Output
error_code
SUCCESS
 or
E_BMODE
if wrong or no module
E_MEMFUL
if no memory resources available
or standard OS-9 error code (refer to the OS-9
Technical Manual Error Codes Section).
Example
RetVal = SMDAD1Init(0);
Note
If the same SM-DAD1 Module is to be accessed from different tasks, the
user must make sure that the actual output status is ensured by using for
example, semaphores within OS-9.