PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
//Run Block
g_timebase = 15629;
g_nSamples = 50000;
g_blockReady = FALSE;
timestamp("Calling ps6000RunBlock now...");
status = ps6000RunBlock( unit->handle, //unit handle
0, //unused
g_nSamples, //number of samples
g_timebase, //timebase
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
while(!g_blockReady)
{
Sleep(1); //do nothing
time_waited++;
if(time_waited>time_to_wait)
{
printf("Waiting loop timed out...\n");
printf("g_blockReady flag = %d \n\n", g_blockReady);
break;
}
}
Code: Select all
ps6000OpenUnit -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetTriggerChannelConditions -- 0
ps6000SetTriggerChannelDirections -- 0
ps6000SetTriggerChannelProperties -- 0
ps6000RunBlock -- 0
ps6000SetDataBuffer -- 0
ps6000GetValues -- 25
Status Value not PICO_OK.
Any Key to Exit.
Loop 1000
ps6000Stop -- 0
Data saved to data.txt in project directory
ps6000CloseUnit -- 0
Main Function Complete.
Any Key to Exit.
Code: Select all
ps6000OpenUnit -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetTriggerChannelConditions -- 0
ps6000SetTriggerChannelDirections -- 0
ps6000SetTriggerChannelProperties -- 0
ps6000RunBlock -- 0
Pre While loop g_blockReady = 0
Code: Select all
ps6000OpenUnit -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetChannel -- 0
ps6000SetTriggerChannelConditions -- 0
ps6000SetTriggerChannelDirections -- 0
ps6000SetTriggerChannelProperties -- 0
ps6000RunBlock -- 0
Pre While loop g_blockReady = 0
Post While loop g_blockReady = 0
ps6000SetDataBuffer -- 0
ps6000GetValues -- 25
Status Value not PICO_OK.
Any Key to Exit.
Loop 1000
g_blockReady should be FALSE Here...it is 0
g_blockReady should now be TRUE it is 1ps6000Stop -- 0
Data saved to data.txt in project directory
ps6000CloseUnit -- 0
Main Function Complete.
Any Key to Exit.