status = ps2000aGetStreamingLatestValues(unit->handle, CallBackStreaming, NULL);
is causing this, i presume due to something before it missed or done but i can't see it when compared to the original and i have attached my code for the background information.
but there is still nothing in the recorded file and if i try to open the file when its writing to another one and it is in use with another application so i cant open but when i close the application the file is still empty.
i have created a global variable g_manualstop which i change to true in this function:
and the oscilloscope loop has while !g_manualstop in it so when i call the above function the loop should exit, close the file and exit the dll. but that can't be happening if the file is still in use.
Actually that hasn't fixed the issue it is just sitting in that while loop which stops that line from executing. i have tried changing the while loop to just while (!g-ready) but still no luck.
yep that and a few other things i found where wrong and it works now.
But ive now got error 67 when i call ps2000aSetSigGenArbitrary in soft trigger mode. I have seen this error sporadically a couple of times before but now it happens after about 3 calls without closing the Picoscope.
I know 67 isn't a part of the driver status codes so what does this mean?
// A driver function has already been called and not yet finished
// only one call to the driver can be made at any one time
#define PICO_DRIVER_FUNCTION 0x00000043UL
OK so to remove this problem i have the DLL running as a separate thread and i will change global variables to control the program.
After doing this i have got signal generation working again but the oscilloscope side wont work. When calling ps2000aGetTimebase in the while loop timeinterval and maxsamples pointers are not set so the loop never exits.
I must be missing something before calling that function.
I have attached my code, Thanks so much for the help
/* find the maximum number of samples, the time interval (in timeUnits),
* the most suitable time units, and the maximum oversample at the current timebase*/
while (ps2000aGetTimebase(unit->handle, timebase, sampleCount, &timeInterval, oversample, &maxSamples, 0))
{
timebase++;
}
if so can you print our timebase, sampleCount and oversample before you hit the loop to check that they are sane values
OK so passing:
offset = 0,
mode = analogue,
repname = a directory,
text = "Ten readings after trigger".
When the program gets to the while loop the values are:
timebase = 1,
sample count = 1024,
time interval = -858993460,
oversample 1,
max samples = -858993460.
I have just tried with your code, modified it to remove the file writing code in BlockDataHandler and it enters the GetTimebase call with the parameters you have mentioned