TimeUnits...please explain
TimeUnits...please explain
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,
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,
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: TimeUnits...please explain
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,
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
Software Dev. Engineer
Re: TimeUnits...please explain
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.
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.
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: TimeUnits...please explain
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.
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
Software Dev. Engineer
Re: TimeUnits...please explain
Perfect, thanks.
You said for one channel enabled. Do you divide that total for two channels? Just wanting to be clear.
You said for one channel enabled. Do you divide that total for two channels? Just wanting to be clear.
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: TimeUnits...please explain
Hi Tim,
When referring to samples, the buffer memory will be divided between active channels.
Regards,
When referring to samples, the buffer memory will be divided between active channels.
Regards,
Hitesh
Software Dev. Engineer
Software Dev. Engineer
Re: TimeUnits...please explain
Thanks.
Re: TimeUnits...please explain
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?
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?
-
- Advanced User
- Posts: 2856
- Joined: Tue May 31, 2011 3:43 pm
- Location: St. Neots, Cambridgeshire
Re: TimeUnits...please explain
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,
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
Software Dev. Engineer