ps3000_get_timebase sometimes works wrong

 
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
Author Message
Guest






PostPosted: Wed Oct 10, 2007 12:11 pm    Post subject: ps3000_get_timebase sometimes works wrong Reply with quote

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
Site Admin


Joined: 01 Dec 2006
Posts: 658
Location: St Neots

PostPosted: Thu Oct 11, 2007 10:58 am    Post subject: Reply with quote

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






PostPosted: Thu Oct 11, 2007 12:07 pm    Post subject: Reply with quote

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






PostPosted: Thu Oct 11, 2007 12:26 pm    Post subject: Reply with quote

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
Site Admin


Joined: 27 Mar 2007
Posts: 80
Location: Cambridgeshire,UK

PostPosted: Mon Oct 15, 2007 1:17 pm    Post subject: Reply with quote

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






PostPosted: Mon Oct 15, 2007 3:55 pm    Post subject: Reply with quote

Oh, thanks! You hit the point.

Sometimes short formal descriptions in manual are not enough.

---
Best regards,
Serg
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group