PET-7H16M Quick Use Manual P20
[C program Snippet code]
HANDLE hHS;
WORD BufferStatus=0;
float fdataBuffer[10000];
unsigned long ulleng=0;
hHS = HS_Device_Create(“192.168.1.1”);
//Create a connection to the device and initialize the device
HS_SetAIScanParam(hHS, 8, 0, 0, 100000, 2000000, 0,0);
/*Set the AI scan parameter
Sampling rate =100KHz
Trigger mode = 0 (0: Software trigger)
TargetCnt =2000000 (2000000 samples for acquisition)
*/
HS_StartAIScan
(hHS);
//Start data acquisition of scanning AI channel
ret=HS_GetAIBufferStatus(hHS,&BufferStatus,&ulleng);
// Determine how much data is in the buffer
if(ret==false){
printf("Error code 0x%x\r\n",HS_GetLastError());
}
else
{
if(BufferStatus>2)
//AI buffer overflow
{
/* 2: AD_BUF_OVERFLOW
4: AD_SCAN_STOP
8: AD_DATA_SAMPLING_TIMEOUT
*/
break;