TimeUnits...please explain

Post your .Net discussions here
Post Reply
TimOster
Newbie
Posts: 0
Joined: Mon Dec 01, 2014 5:36 pm

TimeUnits...please explain

Post by TimOster » Tue Jun 12, 2018 6:02 pm

Hi,
Can you please explain how the following code from the example app functions:

'Find the maximum number of samples the time interval (in TimeUnits)
'the most suitable time units and the maximum oversample at the current timebase

Dim timebaseStatus As Short = 0
Dim timebase As Short = timebaseNumericUpDown.Value
Dim numSamples As Integer = CInt(tbNumSamples.Text) 'this is mine so I can select the number
Dim timeInterval As Integer
Dim timeUnits As TimeUnits
Dim oversample As Short = 1
Dim maxSamples As Integer = 0

Do Until timebaseStatus = 1
timebaseStatus = ps2000_get_timebase(ps2000Handle, timebase, numSamples, timeInterval, timeUnits, oversample, maxSamples)
If timebaseStatus = 0 Then
timebase = timebase + 1
End If
Loop

What is the math I need to do to set these values?

EDIT: Is the time/div in the scope app just there to control display? Meaning it has nothing to do with data capture? UPDATE: Found that, yes nothing to do with capture.


Thanks,

Hitesh
PICO STAFF
PICO STAFF
Posts: 2855
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: TimeUnits...please explain

Post by Hitesh » Wed Jun 13, 2018 10:30 am

Hi Tim,

You can use this function to determine whether the sampling rate you wish to use for your data capture is valid.

The timebase index of 0 should correspond to the fastest possible sample interval for the device (5 ns for the PicoScope 2205A), with subsequent timebase indices corresponding to a sampling interval twice that of the previous.

The number of samples is the number of samples per channel while the max_samples parameter should give you the maximum number available based on your channel set-up.

The example starts with the smallest possible that tries to find the fastest possible sample rate.

Do you know the desired sample rate or are you trying to find the fastest possible?

Regards,
Hitesh

Software Dev. Engineer

TimOster
Newbie
Posts: 0
Joined: Mon Dec 01, 2014 5:36 pm

Re: TimeUnits...please explain

Post by TimOster » Wed Jun 13, 2018 3:33 pm

I'm writing a vb.net form example right now that we will use to add the PicoScope to our in-house ATE system. It is just to learn to use the scope.

I guess I figured out that I need to think differently. I started on the bench and have been using scopes a long time, so I think like that. What I've decided is I need to think of an ADC, rather than a scope, and program that way.

Can you supply the formula used to determine the various parameters? I don't have one specific signal. I also commented in another thread, but we would like to be able to use the math functions also. THD, Freq...all would be very useful for us.

We test some pretty high end modules here at Quantum Design. Having the much higher speed available from your scope would allow us to capture high frequency noise that we just can't see sampling at 200mS intervals.

Thanks.

Hitesh
PICO STAFF
PICO STAFF
Posts: 2855
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: TimeUnits...please explain

Post by Hitesh » Thu Jun 14, 2018 11:45 am

Hi Tim,

I believe you have a 2205A? In that case the timebase indices would correspond to the following sampling intervals:

0 -> 5 ns (200 MS/s)
1 -> 10 ns (100 MS/s)
2 -> 20 ns (50 MS/s)
3 -> 40 ns (25 MS/s)
4 -> 80 ns (12.5 MS/s)
and so on.

For the 2204A, timebase 0 is 10 ns.

The maximum samples for the 2205A would be just over 16,000 samples with one channel enabled.

I hope this helps.
Hitesh

Software Dev. Engineer

TimOster
Newbie
Posts: 0
Joined: Mon Dec 01, 2014 5:36 pm

Re: TimeUnits...please explain

Post by TimOster » Thu Jun 14, 2018 2:28 pm

Perfect, thanks.

You said for one channel enabled. Do you divide that total for two channels? Just wanting to be clear.

Hitesh
PICO STAFF
PICO STAFF
Posts: 2855
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: TimeUnits...please explain

Post by Hitesh » Thu Jun 14, 2018 4:07 pm

Hi Tim,

When referring to samples, the buffer memory will be divided between active channels.

Regards,
Hitesh

Software Dev. Engineer

TimOster
Newbie
Posts: 0
Joined: Mon Dec 01, 2014 5:36 pm

Re: TimeUnits...please explain

Post by TimOster » Mon Jun 18, 2018 7:21 pm

Thanks.

TimOster
Newbie
Posts: 0
Joined: Mon Dec 01, 2014 5:36 pm

Re: TimeUnits...please explain

Post by TimOster » Tue Jun 19, 2018 2:24 pm

OK, so for a single channel.

If X = the number of cycles to read,

16K/(period * X) = max sample rate. Then look for the next slower sample rate.

Or do I have that backwards (period * X)/16K?

Hitesh
PICO STAFF
PICO STAFF
Posts: 2855
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: TimeUnits...please explain

Post by Hitesh » Thu Jun 21, 2018 9:08 am

Hi Tim,

Both are correct. If it is the sample interval you are looking for (which is what you would then use to work out the timebase index) then you can use the latter.

The ps2000_get_timebase() function will indicate the maximum number of samples that can be collected based on the channels that are enabled.

Regards,
Hitesh

Software Dev. Engineer

Post Reply