PCI-1718 Series User Manual 40
Example Code:
/********This code supports TurboC 3.0 or later versions********/
#include <stdio.h>
#include <DOS.h>
#define AD_NO 4096; // Number of Samples
int base_addr;
void main(void)
{
int ad_lb,ad_hb; //Declaration
int i;
int eoc;
/****** Access your base address ******/
//Add your code here
/*******************************************/
outportb(base_addr+0x02,0x00); //Set Channel 0
outportb(base_addr+0x01,0x00); //Set A/D range
outportb(base_addr+0x02,0x11); //Set Channel 1
outportb(base_addr+0x01,0x01); //Set A/D range
outportb(base_addr+0x02,0x10); //Scan Channel 0-1
outportb(base_addr+0x09,0x00);
while(i<AD_NO){
outportb(base_addr+0x00,0); //Software Trigger
do {eoc=inportb(base_addr+0x08);
eoc=eoc&0x01;//Get EOC}
while(eoc!=0); //Check EOC
ad_lb=inportb(base_addr+0x00);// A/D LowByte
ad_hb=inportb(base_addr+0x01);// A/D HighByte
i++;
}
}