|
|
| Author |
Message |
Guest
|
Posted: Wed Oct 10, 2007 12:11 pm Post subject: ps3000_get_timebase sometimes works wrong |
|
|
ps3000_get_timebase function sometimes returns wrong time_units value.
It occures at high timebase values. The typical call
| Code: |
ps3000_get_timebase(handle,
9, // timebase
262144, // no_of_samples
time_interval,
time_units,
1, // oversample
max_samples)
|
returns 3 for time_units (instead of 2). The error is not 100% reproducible, but rather frequent one. I'm using Picoscope 3224 and latest R5.xx software
---
Best regards,
Serg |
|
| Back to top |
|
 |
ziko Site Admin

Joined: 01 Dec 2006
Posts: 596
Location: St Neots
|
Posted: Thu Oct 11, 2007 10:58 am Post subject: |
|
|
Hi Serg,
The function will return 0 if it has failed and a non zero value if it has passed. So the number does not matter as long as its not a zero when it passes.
Hope this helps. |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Oct 11, 2007 12:07 pm Post subject: |
|
|
| ziko wrote: | Hi Serg,
The function will return 0 if it has failed and a non zero value if it has passed. So the number does not matter as long as its not a zero when it passes.
Hope this helps. |
The bug report was about time_units out value, not about the function result. I just want to know will you fix it or I must write my own workaround - no problem really.
---
Best regards,
Serg |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Oct 11, 2007 12:26 pm Post subject: |
|
|
May be I'm not quite clear in starting post.
the function call:
| Code: |
ps3000_get_timebase(handle,
9, // timebase
262144, // no_of_samples
time_interval,
time_units,
1, // oversample
max_samples)
|
the function returns a non zero value (OK)
the correct out value for time_units is 2
the actual out value for time_units is 3
device: Picoscope 3224
---
Best regards,
Serg |
|
| Back to top |
|
 |
markB Site Admin

Joined: 27 Mar 2007
Posts: 80
Location: Cambridgeshire,UK
|
Posted: Mon Oct 15, 2007 1:17 pm Post subject: |
|
|
Here are the argument descriptions from the PS3000 manual:
| Quote: | time_interval, a pointer to the time interval, in nanoseconds, between readings at the selected timebase. If a null pointer is passed, nothing will be written here.
time_units, a pointer to the most suitable units that the results should be measured in. This value should also be passed when calling ps3000_get_times_and_values(). If a null pointer is passed, nothing will be written here.
|
I think the confusion has arisen because the time_interval is always measured in ns. The time_units are the highest precision units that the times can be returned in (from ps3000_get_times_and_values()) without overflowing a ULONG.
Eg: given your parameters, time_interval is 25,600ns. Multiplying this by 262,144 samples gives a collection time of 6,710,886,400ns. The maximum collection time in ns that you can express in a ULONG is 4,294,967,296ns. The function therefore returns us as the most suitable time unit. |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Oct 15, 2007 3:55 pm Post subject: |
|
|
Oh, thanks! You hit the point.
Sometimes short formal descriptions in manual are not enough.
---
Best regards,
Serg |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|