Test and Measurement Forum

fast streaming max_samples, overview buffers clarification

Post your C and C++ discussions here

fast streaming max_samples, overview buffers clarification

Postby csaether » Wed Nov 25, 2009 12:12 am

The max_samples value will cause the driver to allocate non-paged memory and is the circular buffer used to buffer samples between calls to ps3000_get_streaming_last_values, right?

The overview buffer is paged process memory, right?

The amount of memory allocated depends on which channels are enabled, is that true for both?

If max_samples was 1000, say, and overview_buffers was only 200, would that make any sense? I'm imagining that somehow a time interval would pass to accumulate nearly max samples, then get_streaming_values would be called in a tight loop to retrieve 200 at a time until emptied, then another long wait.

I'm a bit confused because I had a version of my program with max_samples smaller than overview_buffers. I would get a number of values back greater than max_samples but it must mean than newer data had overwritten old data.

Enlightenment requested, thanks.
csaether
Newbie
 
Posts: 0
Joined: Tue Nov 24, 2009 11:27 pm

Re: fast streaming max_samples, overview buffers clarification

Postby Robin » Wed Nov 25, 2009 3:31 pm

Hi

max_samples specifies the number of samples the driver should store for each channel. If you use auto stop, the unit will stop streaming when this buffer is full.

The overview buffers allow you to access aggregated data as it is collected.

The value of max_samples does not affect the overview buffers.

When you call get_last_values, you are retrieving the latest values from the overview buffers, so if you have a low value for max_samples the number of values returned could be greater than max_samples. In this case the buffer specified by max_samples will have been overwritten.

I hope this makes sense

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: fast streaming max_samples, overview buffers clarification

Postby csaether » Wed Nov 25, 2009 3:41 pm

So is the driver asynchronously copying data from the max_samples to the overview_buffers before it wraps?

Or should max_samples always be at least as big as overview_buffers so the data is always valid?

When I run with max_samples at, say, 200, and get more than 200 back in overview_buffers, the overflow flag is never set.

Does max_samples need to be at least as big as overview_buffers to guarantee valid data?
csaether
Newbie
 
Posts: 0
Joined: Tue Nov 24, 2009 11:27 pm

Re: fast streaming max_samples, overview buffers clarification

Postby Robin » Wed Nov 25, 2009 3:52 pm

csaether wrote:So is the driver asynchronously copying data from the max_samples to the overview_buffers before it wraps?


Yes, it is also performing the aggregation as the overview buffers contain aggregated data.

csaether wrote:Or should max_samples always be at least as big as overview_buffers so the data is always valid?


The value of max_samples does not affect the overview buffers.

csaether wrote:When I run with max_samples at, say, 200, and get more than 200 back in overview_buffers, the overflow flag is never set.


The overflow flag indicates a voltage overflow.

csaether wrote:Does max_samples need to be at least as big as overview_buffers to guarantee valid data?


The value of max_samples does not affect the overview buffers.


Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: fast streaming max_samples, overview buffers clarification

Postby csaether » Wed Nov 25, 2009 4:00 pm

Thanks. Makes sense. Sorry about the dumb overflow flag question.

Having fun messing with this. Very cool device.
csaether
Newbie
 
Posts: 0
Joined: Tue Nov 24, 2009 11:27 pm


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests