PET-7H16M Quick Use Manual P17
[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, 20000, 0, 0,0);
/*Set the AI scan parameter
Sampling rate =20KHz
Trigger mode = 0 (0: Software trigger)
TargetCnt =0 (0: Continuous mode)
*/
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(ulleng)
{
readsize=
HS_GetAIBuffer
(hHS,fdataBuffer, ulleng);
// Read the
data from the buffer
…