I have written a small console application that simply stores a given amount of samples at a given sample frequency.
What i am finding at the moment is that it will occasionally hang when ps6000RunBlock is called. My wait loop with timeout and ps6000GetValues will return a status of PICO_NO_SAMPLES_AVAILABLE. I am using the exact same timebase/buffer size with each test and it will seemingly randomly hang.
My input signal is just random voltage from a piezoelectric bimorph.
Snippet of RunBlock module:
- Code: Select all
g_timebase = 15629;
g_nSamples = 50000;
g_blockReady = FALSE;
timestamp("Calling ps6000RunBlock now...");
status = ps6000RunBlock( unit->handle, //unit handle
g_nSamples, //number of samples
0, //oversample flag
&timeIndisposed, //pointer to approx time variable
0, //memory segment index
CallBackBlock, //pointer to callback function
NULL ); //pParameter
printf("\tps6000RunBlock ------ %d \n", (int)status);
//Wait for block to complete then ps6000Stop
Sleep(1); //do nothing
printf("Waiting loop timed out...\n");
printf("g_blockReady flag = %d \n\n", g_blockReady);