PCI-1202/1602/180x Series Card
Multi-Function Boards
User Manual/ Ver. 4.8/ Mar. 2015/ PMH-0014-48/ Page: 67
The demo program to start MagicScan operation is given as follows:
P180x_StartScan(…) is designed for PCI-1800/1802 series
P1202_StartScan(…) is designed for PEX-1202/PCI-1202 series
P1602_StartScan(…) is designed for PCI-1602 series
WORD
P180X_StartScan
(WORD wSampleRate, WORD wNum)
{
WORD wVal;
WORD wRetVal;
wMagicNum=wNum;
disable_timer0();
/* Disable pacer timer first */
/* start MagicScan controller */
wRetVal=pic_control(0xD400);
/* 11?1 01?? ???? ???? cmd_101=start scan */
if (wRetVal!=0) return(wVal);
/* Clear FIFO to clear all data */
outport(wAddrCtrl,0x2000);
/* Bit15=0=clear FIFO, Bit13=1=not PIC cmd */
outport(wAddrCtrl,0xA000);
/* Bit15=1=no reset FIFO, BIT13=1=not PIC cmd */
enable_timer0(wSampleRate);
/* Enable pacer timer, sampling rate=8 M/dwSample */
magic_scan();
/* Call MagicScan subroutine(DOS) or thread(Windows) */
return(NoError);
}