3.6 The A/D Fixed-mode Functions
3.6.1 P1602_SetChannelConfig
z
Description :
This function will set the A/D channel’s configuration code. This
function will set the active A/D channel for
P1602_AdPolling
,
P1602_AdsPolling
and
P1602_AdsPacer
functions. This function will refer to the current active OME-PCI-1602
board. Use the P1602_ActiveBoard(….) to select the active board.
z
Syntax :
WORD P1602_SetChannelConfig(WORD wChannel, WORD wConfig);
z
Input Parameter :
wChannel : A/D channel number
wConfig : Configuration code. Refer to "
Section 3.1 Configuration Table
"
z
Return Value :
NoError : OK
ExceedBoardNumber: invalid board number
FindBoardError : cannot find the OME-PCI-1602 board
AdControllerError : MagicScan controller hardware handshake error
z
Demo Program : DEMO1.C
3.6.2 P1602_AdPolling
z
Description :
This function will perform a single A/D conversion by software
polling. The
P1602_SetChannelConfig
function can be used to change channel or
configuration code used by the
P1602_AdPolling
function. This function will refer to the
current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the
active board.
z
Syntax :
WORD P1602_AdPolling(float *fAdVal);
z
Input Parameter :
*fAdVal : address of
fAdVal
which will contain the A/D data (16 bits), this data
is automatically converted to volts based on the setting
P1602_SetChannelConfig
.
z
Return Value :
NoError : OK
ExceedBoardNumber: invalid board number
FindBoardError : cannot find the OME-PCI-1602 board
AdPollingTimeOut : hardware timeout error
z
Demo Program : DEMO1.C
40
Summary of Contents for OME-PCI-1602
Page 37: ... Demo Program DEMO9 C 37 ...