fast streaming max_samples, overview buffers clarification

Post your C and C++ discussions here
Post Reply
csaether
Newbie
Posts: 0
Joined: Tue Nov 24, 2009 11:27 pm

fast streaming max_samples, overview buffers clarification

Post by csaether »

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.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: fast streaming max_samples, overview buffers clarification

Post by Robin »

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

csaether
Newbie
Posts: 0
Joined: Tue Nov 24, 2009 11:27 pm

Re: fast streaming max_samples, overview buffers clarification

Post by csaether »

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?

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: fast streaming max_samples, overview buffers clarification

Post by Robin »

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

csaether
Newbie
Posts: 0
Joined: Tue Nov 24, 2009 11:27 pm

Re: fast streaming max_samples, overview buffers clarification

Post by csaether »

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

Having fun messing with this. Very cool device.

Post Reply