2205A C/C++ problem with oversample

Post your Linux discussions here
Post Reply
IanL
Newbie
Posts: 0
Joined: Wed May 12, 2021 5:30 pm

2205A C/C++ problem with oversample

Post by IanL »

Hi,

I'm using the 2000 series API on Ubuntu 20.04 with a 2205A PicoScope. Working well except for a strange problem with oversampling (in block mode - no trigger).

I can give ps2000_get_timebase() and ps2000_run_block() oversample values of 1 and 4 with results as expected, but as soon as I move above 4 (to the other valid values of 16, 64, 256) it won't play nice. Both functions return error values.

There does seem to be some confusion in the SDK about this. Whereas the 'Programmers Guide' makes it clear that 'oversample' is an input param to both of these calls, the sample programme, ps2000Con.c, says, "Find the maximum number of samples, the time interval (in time_units), the most suitable time units, and the maximum oversample at the current timebase", as if 'oversample' is an output param (which it surely cannot be).

So that hasn't helped reassure me. If anyone can shed any light I'd be grateful.

Resolution enhancement up to 12 bits does seem to work with my unit controlled by PicoScope 6 in Windows (haven't tried that in Linux).

Cheers, Ian.

IanL
Newbie
Posts: 0
Joined: Wed May 12, 2021 5:30 pm

Re: 2205A C/C++ problem with oversample

Post by IanL »

Sorry to re-post but I think I now have a little more clarity with this.

The situation is that, for any given (valid) value of the 'oversample' argument passed to ps2000_get_timebase(), if the value of the 'no_of_samples' argument is greater than the 'max_samples' value it would return, the function fails (returns zero and sets 'time_interval' to zero) regardless of anything else - in particular, regardless of the value of 'timebase' passed to it.

The only way therefore that I can use it to find the range of 'timebase' and 'no_of_samples' values which are valid to be passed to ps2000_run_block() is to pass a very low 'no_of_samples' value (eg 1), see what it returns in 'time_interval', and work backwards from that (to a 'timebase' enumeration).

Doing this on my system (only one channel enabled and ETS switched off) these are the values I get from ps2000_get_timebase()

Code: Select all

oversample (input)                      max_samples (output)       time_interval (output)      time_units
1 (no oversample)                       16256                        10                        0
4                                        4064                        40                        0
16                                       1016                       160                        0
64                                        254                       640                        0
256                                        64                      2560                        1
Is this a known issue or am I seriously missing something here? It does not seem to be the published behaviour of this call. And the max_samples available at the higher oversample values seem very low - unusably so. Calling ps2000_run_block() with values within these parameters is successful, but otherwise not. So, to that extent at least, ps2000_get_timebase() would seem to be telling the truth.

I.

Post Reply