Pepper Computer RS232, RS485 user manual SMDAD1Init Syntax, Description

Models: RS485 RS232

1 320
Download 320 pages 36.43 Kb
Page 173
Image 173

Chapter 5 Analog Modules

SMART I/O User’s Manual

 

 

 

 

 

 

 

 

 

 

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.

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.

5

Input

u_int8 PortNr

Output

error_code

Example

SM-Port number to initialize (from 0 to 10)

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

RetVal = SMDAD1Init(0);

 

 

 

 

March 12, 1996

©1996 PEP Modular Computers GmbH

Page 5 - 17

 

 

Page 173
Image 173
Pepper Computer RS232, RS485 user manual SMDAD1Init Syntax, Description