PS3000 Rapid Block Mode with > 2M samples

Post your C and C++ discussions here
Post Reply
jokkebk
Newbie
Posts: 0
Joined: Tue May 15, 2012 4:27 pm

PS3000 Rapid Block Mode with > 2M samples

Post by jokkebk »

Hello,

Background: I've been porting my Picoscope composite decoder software to 3000-series scopes and adding color support. I'm now using timebase = 3 to achieve captures at 16 ns intervals. To guarantee two full NTSC frames, I'll need 3 150 000 samples. Everything is working fine, but currently PS3000 data acquisition takes 75 % of time, 213 ms per frame, which effectively limits the FPS of my program to ~4.

The programming manual tells that 50 ms of setup time is usually needed for each capture, and to avoid that, suggests the use of rapid block mode and avoiding setup functions between calls. However:

1. ps3000aGetValuesBulk call fails when buffer size is over 2 080 000 samples - this is very close to 2^20, which suggests me that there's some kind of driver limit for using this function
2. ps3000aGetValuesBulk actually seems a bit slower (a few ms) than ps3000aGetValues when I capture 2M samples or less
3. Rapid mode doesn't seem to give and speedup when using it for single captures

So my questions are:

* Why the ...Bulk() method fails with larger capture sizes?
* Is rapid mode actually even supposed to speed up the initial setup time for capture (I trust it greatly reduces gaps between consecutive captures, but I only need 1 capture at a time to provide minumum latency to decoding)?
* Is ps3000aGetValuesBulk() actually needed for rapid mode, or could I just use ps3000aGetValues() as long as I set number of captures?
* Are there any other ways I could speed up the capture? (I have a gut feeling that probably not)

In case it helps, here's essentially my "inner loop" currently (removing ps3000aSetDataBuffer for consecutive calls had a speedup of 0.5%...):

ps3000aRunBlock(handle, 0, samples, timebase, 1, &timeIndisposed, 0, NULL, NULL));

do {
ps3000aIsReady(handle, &ready);
Sleep(0);
} while(!ready);

ps3000aSetDataBuffer(handle, PS3000A_CHANNEL_A, buffer, samples, 0, PS3000A_RATIO_MODE_NONE);
ps3000aGetValues(handle, 0, (unsigned long*)&samples, 1, PS3000A_RATIO_MODE_NONE, 0, overflow);
ps3000aStop(handle);

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PS3000 Rapid Block Mode with > 2M samples

Post by Martyn »

Which 3000 scope do you have, and how many channels are active ?

When the Bulk method fails what is the actual error ?


RapidBlockMode is intended to capture multiple blocks to the scopes memory before downloading the complete set to the PC. The trigger re arm time between each block captured to the scope will be 1usec or less, but restarting the process will incur a significant delay as the data is downloaded to the PC.

If you only wish to capture single blocks then you would use BlockMode and the trigger rearm time between blocks will be of the order of 50msecs subject to PC and USB usage.

GetValuesBulk downloads multiple segments from a RapidBlock capture, this can be done using GetValues in a loop.
Martyn
Technical Support Manager

Post Reply