ICP DAS USA PCI-1202L User Manual page 62

Multi-function boards
Table of Contents

Advertisement

PCI-1202/1602/180x Series Card
Multi-Function Boards
 Calculate the A/D Value
The demo program to calculate the real A/D value is given as follows:
double ComputeRealValue(DWORD dwAdConfig, DWORD dwAdHex)
{
WORD wZERO;
double dfMAX, dfVal;
switch (dwAdConfig)
{
case 0 : wZERO=2048; dfMAX=5.0;
case 1 : wZERO=2048; dfMAX=2.5;
case 2 : wZERO=2048; dfMAX=1.25;
case 3 : wZERO=2048; dfMAX=0.625; break;
case 4 : wZERO=2048; dfMAX=10.0;
case 5 : wZERO=2048; dfMAX=5.0;
case 6 : wZERO=2048; dfMAX=2.5;
case 7 : wZERO=2048; dfMAX=1.25;
case 8 : wZERO=0; dfMAX=10.0/2.0;
case 9 : wZERO=0; dfMAX=5.0/2.0;
case 10: wZERO=0; dfMAX=2.5/2.0;
case 11: wZERO=0; dfMAX=1.25/2.0;
case 0x10 : wZERO=2048; dfMAX=5.0;
case 0x11 : wZERO=2048; dfMAX=0.5;
case 0x12 : wZERO=2048; dfMAX=0.05;
case 0x13 : wZERO=2048; dfMAX=0.005;
case 0x14 : wZERO=2048; dfMAX=10.0;
case 0x15 : wZERO=2048; dfMAX=1.0;
case 0x16 : wZERO=2048; dfMAX=0.1;
case 0x17 : wZERO=2048; dfMAX=0.01;
case 0x18 : wZERO= 0; dfMAX=10.0/2.0;
case 0x19 : wZERO= 0; dfMAX=1.0/2.0;
case 0x1A : wZERO= 0; dfMAX=0.1/2.0;
case 0x1B : wZERO= 0; dfMAX=0.01/2.0;
default: return(ConfigCodeError); }
dfVal=(((double)(wAdHex)-wZERO)/2048.0)*dfMAX;
return(dfVal);
}
break;
break;
break;
break;
break;
break;
break ;
B4=0 is used to identify PGL
break;
break;
break;
break;
break;
break;
break;
break;
break;
break ;
break;
break;
B4=1 is used to identify PGH
break ;
break;
break;
break;
User Manual/ Ver. 4.8/ Mar. 2015/ PMH-0014-48/ Page: 62
For PEX-1202
and
L
PCI-1202/1800/1802
(L/LU)
Note:
For PEX-1202
and
H
PCI-1202/1800/1802
(H/HU)
Note:

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents