A/d , d/a functions, A826_ad, A826_da – Omega Engineering OME-A826PG User Manual
Page 40: 3 a/d , d/a functions, 1 a826_ad 3.3.2 a826_da, 1 a826_ad, 2 a826_da
OME-A-826PG Software Manual [Win 95/98/NT]
3.3
A/D , D/A Functions
3.3.1 A826_AD
• Description :
This subroutine will perform a A/D conversion by polling. The A/D converter is
16 bits for A82PG. This subroutine will compute the result according to the
configuration code.
• Syntax :
float A826_AD(WORD wBase, WORD wChannel, WORD wConfig);
• Parameter :
wBase
: [
Input
] I/O port base address, for example, 0x220
wChannel
: [
Input
] A/D channel number,
wConfig
:
[
Input
] Configuration code, refer to 1.2 for detail information
• Return Value :
AdError2
: A/D converter error
Other value
: The floating point value of A/D conversion
3.3.2 A826_DA
• Description :
This subroutine will send the 16 bits data to D/A analog output. The output
range of D/A maybe 0 to 5V or 0 to10V setting by hardware jumper, JP1. The
software can not detect the output range of D/A converter. For examples, if
hardware select -5V, the 0xfff will send out 5V. If hardware select -10V, the
0xfff will send out 10V. The factory setting select 0-5V D/A output range.
• Syntax :
WORD A826_DA(WORD wBase, WORD wChannel, WORD wHexValue);
• Parameter :
wBase
:
[
Input
] I/O port base address, for example, 0x220
wChannel
:
[
Input
] D/A channel number, validate for 0
wHexValue :
[
Input
] 16 bits data send to D/A converter
• Return Value :
NoError
: no error
DaChannelError
: wChannel value error, validate only for 0
Date: Aug-15-2000 Ver: 2.2 Page 38