HP (Hewlett-Packard) 9112 Series Network Card User Manual


 
C/C++ Library
45
u Example
#include “9112.h”
main()
{
Int baseAddr, irqNo;
_9112_Initial( CARD_1, &baseAddr, &irqNo);
/* Assume NoError when Initialize PCI-9112 */
/* if the hardware setting for DA output range is 0~5V */
_9112_DA(CARD_1, DA_CH_1 , 0x800 );
printf( "The output voltage of CH1 is 2.5V \n" );
_9112_DA(CARD_1, DA_CH_2 , 0xFFF );
printf( "The output voltage of CH2 is 5V \n" );
}
A more complete program is specified in Appendix A Demo.
Program 'DA_DEMO.C'
5.8 _9112_AD_Set_Channel
u Description
This function is used to set AD channel by means of writing data to the
multiplexed scan channel register. There are 16 single-ended or 8
differential analog input channels in PCI-9112, so the channel number
should be set between 0 to 15 for signled-end analog input mode, and 0
to 7 for differnetial analog input mode. The initial state is channel 0 which
is a default setting by the PCI-9112 hardware configuration.
u Syntax
Visual C++ (Windows-95)
int W_9112_ AD_Set_Channel (int card_number, int ad_ch_no)
Visual Basic (Windows-95)
W_9112_AD_Set_Channel (ByVal card_number As Long, ByVal
da_ch_no As Long) As Long
C/C++ ( DOS)
int _9112_AD_Set_Channel (int card_number, int ad_ch_no )
u Argument
card_number : the card number of PCI-9112
ad_ch_no : channel number to perform AD conversion
for single-ended mode : channel no. is from 0-15; for
differential mode : channel no. is from 0-7