ICP DAS USA PCI-1202 Series Hardware User Manual page 47

Hide thumbs Also See for PCI-1202 Series:
Table of Contents

Advertisement

The demo program to add to MagicScan queue is given as follows:
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;
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 */
wConfig+= 0xD000;
wRetVal=pic_control(wConfig);
if (wRetVal!=0) return(wRetVal);
return(NoError);
}
P1202_AddToScan(...) is designed for PCI-1202H/L/HU/LU
P1602_AddToScan(...) is designed for PCI-1602 and PCI-1602F
PCI-1202/1602/1800/1802 Hardware User's Manual
/* Store for P180X_AdPolling */
/* this is add_to_scan_queue command */
(Ver. 4.2, Dec/2009, PMH-014-42)---- 47

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents