PET-7H16M Quick Use Manual P23
[C program Snippet code]
HANDLE hHS;
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,2000000, 0,0);
/*Set the AI scan parameter
Sampling rate =20KHz
Trigger mode = 0 (0: Software trigger)
TargetCnt =2000000 (2000000 samples for acquisition)
*/
HS_StartLogger(hHS,NULL,2,0);
// Start to record data on the scanning AI
while(;;)
{
ret=HS_GetTotalSamplingStatus(hHS,&ulleng,&triggerStatus);
// Obtain the acquisition status of the data recording process
if(ret==false)
{
printf("Error code 0x%x\r\n",HS_GetLastError());
}
else
{
if(CHECK_BIT(triggerStatus,7)==true && targetCnt>0)
//Number of records reaches the target count
{
if(ulleng>=targetCnt)
{
…
break;
//break the loop