发表于:2006-06-21 08:09:00
楼主
后半块内存中取得的数据永远是0,不知道为什么。
for(int second =1 ; second <=60;) ////采样一分钟
{
DRV_CheckEvent(DriverHandle, (LPT_CheckEvent)&ptCheckEvent);
while(usEventType & ADS_EVT_BUFCHANGE) ////判断是否有bufferChange发生
{
if ((ErrCde = DRV_FAICheck(DriverHandle,
(LPT_FAICheck)&ptFAICheck))!= SUCCESS)
{
AfxMessageBox("DRV_FAICheck Error ");
return ;
}
if(2==gwHalfReady) ///
{
ptFAITransfer.start = gulConvNum/2;
second++;
}
else
ptFAITransfer.start = 0;
ptFAITransfer.ActiveBuf = 0; // single buffer
ptFAITransfer.DataType = gwDataType;
ptFAITransfer.count = gulConvNum/2;
ptFAITransfer.overrun = &gwOverrun;
if ((ErrCde = DRV_FAITransfer(DriverHandle,
(LPT_FAITransfer)&ptFAITransfer)) != 0)
{
AfxMessageBox("DRV_FAITransfer Error ");
return ;
}
for(ULONG j=ptFAITransfer.start;
j<(ptFAITransfer.start+gulConvNum/2);j++)
{/////////////////处理取得的数据 m=(UINT)(((float*)ptFAITransfer.DataBuffer)[j]*2048/10);
*(pab+m)=*(pab+m)+1;
uTotalNum++; /////´计算得到的总数
}
break;
} ///while
} //for