我用以下一段程序,為什么無法上傳大于70個(gè)字節(jié)的數(shù)據(jù),上位機(jī)只能收到前64個(gè)字節(jié)的數(shù)據(jù),為什么?求指點(diǎn)一下迷津? void main ( ) { unsigned char mReadBuf[100]; unsigned long i,mLength; mLength = 64;
printf( "\nCH375 DAQ Test Program V1.0,HJZ1234569,2009.8\n" ); printf( "*** Load DLL: CH375DLL.DLL \n" if ( LoadLibrary( "CH375DLL.DLL" ) == NULL ) return; printf( "*** CH375OpenDevice: 0# \n" ); if ( CH375OpenDevice( 0 ) == INVALID_HANDLE_VALUE ) return; CH375SetTimeout( 0, 5000, 5000 ); CH375SetBufUpload(0,1);
while(1) { Sleep(1000); if ( CH375ReadData( 0, mReadBuf, &mLength ) ) // 接收成功 { printf( "接受成功\n"); for( i=0; i< mLength; i++) printf( "%02XH ",mReadBuf[i]);
printf( "\n"); } else printf( "No Data OR CH375ReadData return error\n"); }
printf( "CH375CloseDevice: 0 \n" );
CH375CloseDevice( 0 );// 關(guān)閉CH375設(shè)備
getch();
}