Hi there!
Having just purchased a Picoscope 3224 for use at work I have a question....
What is the best way to sample 300 times both channels over a 180 second period? (1.66Hz)
There will be a new release of software available on Monday 26th March which has a fix to a bug in the driver. Please try with the above code and the new version of software.
Hello
Thanks for your post with a suggestion on how to sample relatively slowly i.e. 300 samples over a 180 second period.
Firstly the statement ok = ps3000_run_streaming(ps3000_handle, 1600, 3200, TRUE); appears to be incorrect for use with DELPHI 3 or 2006.
An error is generated stating 'incompatable types boolean ~ integer'.
Reading the manual the 'TRUE' statement should be a short int.
As with the Delphi example supplied with the pico software/drivers streaming does not appear to work within the Delphi progamming language (both version 3 and 2006) on my computer.(1.5GHz Acer Laptop with 1Gb of RAM running XP Home)
Fortunately I have now managed to achieve acceptable results by 'block' sampling several times over the 180 second period and dispensing with most of the results. Not ideal........
Do you have any suggestion as to the reason I am having trouble with the streaming function?.
Obviously streaming does work because your PICO SCOPE software functions correctly under all conditions........
davidj's example code is in C and so will not be syntactically correct for Delphi.
He also pointed out that there was a bug in streaming that would be fixed. This fix is now available in the software downloads sections (5.16.2). Does your streaming problem still occur with this latest dll?
Hi
Thanks for your comments regarding streaming within Delphi.
The latest software and drivers have been installed which has now allowed the Delphi streaming example to function.
This example makes use of a windows timer function rather than the 'while' loop suggested by yourselves.
I have tried using a 'while' loop within my own code rather than a timer, such as,
while nsamples <> max_values do
begin
nsamples := ps3000_get_values( ps3000_handle, values_a, values_b, values_c, values_d, overflow, max_values );
end;
but I have found that it just appears to lock itself into a never ending loop waiting for 'nsamples' to increment up to the max_values figure i.e. 112 samples in 180 seconds.
This it never appears to achieve.
Refering to your code suggestion, can you tell me if 'nsamples' is an actual returned value from the 'ps3000_get_values' driver function and thus correct in thinking that it should increment up after each sample is taken?.
nSamples is the numer of samples return from the call to 'ps3000_get_values.'
If you are streaming in Windowed mode, as out example is, nSamples does increment up to the window size.
If you are not in windowed mode only new samples are returned and so nSamples doesnt increment in this way.