Test and Measurement Forum

2 Questions about sample rate and output values of 4824

Post general discussions on using our drivers to write your own software here

2 Questions about sample rate and output values of 4824

Postby volke » Thu Jun 25, 2015 5:24 pm

Hi everybody,
we have 2 Picoscope 4824s and are very happy, but there are two odd things we don't understand about the API and/or the driver. We use Python and the ctypes library. This is all in Streaming Mode. I'll try to be as general as possible, but I can provide more code on request.

1. The desired sample rate is set in ps4000aRunStreaming using sampleInterval and sampleIntervalTimeUnits. On exit, sampleInterval contains the actual assigned time interval. So, for 10 kS/s, we set
Code: Select all
sampleInterval = 100
sampleInterval = ctypes.c_uint32(sample_interval)
sampleIntervalTimeUnits = 3 #Microseconds

result = self.lib.ps4000aRunStreaming(self.handle, ctypes.byref(sampleInterval), sampleIntervalTimeUnits, ... )

expecting an unchanged value of 100 for sampleInterval, but it returns with 99. Similarly, when setting the same 10 kS/s as 100000 Nanoseconds, the value of sampleInterval after ps4000aRunStreaming is 99999. (We tried to be clever and set 100001 Nanoseconds, but it also comes out as 99999.)
Why does the driver change that value? According to the Programmer's Guide, a 100 microsesonds interval is timebase 8001, a 99 microseconds interval is timebase 7921. 99999 Nanoseconds is not a feasible timebase. What is the actual sample rate?

2. One channel of one of the picoscopes has a little shift in output values. If we leave the inputs floating and record the unique values of all 8 channels, we get:
Code: Select all
[-36. -18.   0.  17.]
[-53. -36. -18.   0.]
[  2.  19.  37.  55.  72.]
[-36. -18.   0.  17.  35.]
[-36. -18.   0.  17.]
[-36. -18.   0.  17.]
[-18.   0.  17.  35.]
[-18.   0.  17.  35.]
Channel 3 is obviously a bit skewed, registering 2 instead of 0, besides being offset a little bit. The scopes are not calibrated, and the other scope doesn't do this. What could be the reason and can this be corrected?

I hope someone can help me or provide some answers, thanks in advance!
If answers to these questions can be found in the forum already, I apologize, but I didn't find them. I'll be happy to provide more information.

Greetings, volke
Posts: 0
Joined: Thu Jun 25, 2015 4:16 pm

Re: 2 Questions about sample rate and output values of 4824

Postby Hitesh » Tue Jun 30, 2015 4:13 pm

Hi volke,

You should find that the timebase index for 100us is 7999 as the formula is:

Code: Select all
sampling_interval = 12.5 * (n + 1)

I have tested 100us and 100000ns and this is returned without any issues. However, 99us (which is a multiple of 12.5ns) is returned as 98 so some further investigation is required.

What is the driver version of the ps4000a.dll that you are using?

With regards to your second point, do you see a skew in the data for channel C when using the PicoScope 6 software?

It might be useful to e-mail a PicoScope 6 data file showing the effect to support@picotech.com and if the PicoScope needs to come back for an adjustment we can issue you with a returns number.


Technical Specialist
Pico Technology
Site Admin
Site Admin
Posts: 2026
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests