PCI-1202/1602/180x Series Card
Multi-Function Boards
User Manual/ Ver. 4.8/ Mar. 2015/ PMH-0014-48/ Page: 66
The demo program to add to MagicScan queue is given as follows:
P180x_AddToScan(…) is designed for PCI-1800/1802 series
P1202_AddToScan(…) is designed for PEX-1202/PCI-1202 series
P1602_AddToScan(…) is designed for PCI-1602 series
WORD
P180X_AddToScan
(WORD wAdChannel, WORD wAdConfig, WORD
wAverage, WORD wLowAlarm, WORD wHighAlarm, WORD wAlarmType)
{WORD wConfig,wChannel,wRetVal;
if (wAlarmType>=5) return(AlarmTypeError);
wMagicLowAlarm[wMP]=wLowAlarm;
wMagicHighAlarm[wMP]=wHighAlarm;
wMagicAlarmType[wMP]=wAlarmType;
wChannel = wAdChannel&0x1f;
wMagicChannel[wMP]=wChannel;
wSysConfig = wAdConfig&0x1f;
/* Store for P180X_AdPolling */
wMagicConfig[wMP]=wSysConfig;
wMagicAve[wMP]=wAverage;
wConfig = wAdConfig&0x0f;
wConfig = wConfig << 6;
wConfig += wChannel;
/* Bit15=1 --> no reset FIFO
Bit14=1
Bit13=?
Bit12=1 --> command [100] --> add_to_scan command
Bit11=0
Bit10=0
Bit9 =B --> Range control code [BB] --> unipolar/bipolar & divided by 2
Bit8 =B
Bit7 =B --> gain control code [BB] --> 1/10/100/1000 or 1/2/4/8
Bit6 =B
Bit5 =?
Bit4-Bit0 --> channel number */
= 0xD000;
/* this is add_to_scan_queue command */
wRetVal=pic_control(wConfig);
if (wRetVal!=0) return(wRetVal);
return(NoError);
}