Omega 1002 manual

Page 43

char c;

clrscr();

P1002_DriverInit(&wBoards);

printf("\n(1) Threr are %d OME-PCI-1002 Cards in this PC",wBoards); if ( wBoards==0 )

{

putch(0x07); putch(0x07); putch(0x07);

printf("(1) There are no OME-PCI-1002 card in this PC !!!\n"); exit(0);

}

printf("\n(2) Show the Configuration Space of all OME-PCI-1002:"); for(i=0; i<wBoards; i++)

{

P1002_GetConfigAddressSpace(i,&wBaseAddr,&wIrq,&wPLX);

printf("\n Card_%d: wBaseAddr=%x, wIrq=%x, wPLX=%x",i,wBaseAddr,wIrq,wPLX);

}

P1002_GetConfigAddressSpace(0,&wBaseAddr,&wIrq,&wPLX); /* select card_0 */ printf("\n(3) *** Card_0, wBaseAddr=%x ***\n",wBaseAddr);

SetupTimer(0,1);

// AdPolling have to disable timer 0

AdPolling(0,0,23);

// channel=0, gain=+/-10, delay=23us

for(i=0;i<10;i++)

{

outp(wBaseAddr+0x1c,01); // A/D software tirgger while(1)

{

if( ((inpw(wBaseAddr+0x10))&0x01)==1) // check A/D busy? break;

}

wAdData=((inpw(wBaseAddr+0x30))&0x0fff);

printf("\nRang:+/-10V, Counter %d ,ADC channel 0 value: 0x%xH",i,wAdData);

}

P1002_DriverClose();

}

43

Image 43
Contents User’sGuide Servicing North America Table of Contents Software and Demo Program Diagnostic Program General Description IntroductionX86 System Block DiagramFeatures Power Consumption SpecificationsAnalog Inputs 4 A/D Trigger Methods 3 D/I and D/OInterrupt Channel Programmable Timer/CounterOME-PCI-1002 series multifunction cards ApplicationsRelease Notes Product Check ListBoard Layout Hardware ConfigurationA/D Calibration Jumper SettingOME-PCI-1002 System Function Block System Block DiagramOME-DB-8225 OME-DB-37 Daughter BoardsOME-DB-16P Isolated Input Board OME-DB-16R Relay Board Analog Input Signal Connection Page Page Signal Shielding Jumper Settings Connectors Page O Registers How to Find the I/O AddressPage I/O Address Map Section 8254 Registers Status Register Clear Interrupt Interrupt Source Selection General Control RegisterTrigger Method Selection Digital I/O Function OperationA/D trigger 8254 TimerSymbol Name Minimum Maximum CPU A/D ConversionSuggested Settling Times 1 A/D Conversion Trigger Modes Software Trigger and Polling Techniques Page Page Software and Demo Program Driver Plug & Play Test Power-ON Plug & Play TestA/D Test D I/O TestWARRANTY/DISCLAIMER Temperature