Test and Measurement Forum

Sampling data long timebases times out to early?

Post your Linux discussions here

Sampling data long timebases times out to early?

Postby wayoda » Fri Aug 22, 2008 9:36 am

Hi, I get early timeouts in block mode when using Timebases >= 14.

Product : PS2104
Library : PS2000 3.6.2.0. Linux
Settings :
No Trigger (Trigger-channel set to 5 timeout to 0)!
Requests are made in block-mode. I request 8000 samples (the hardware buffer size on the device).

This is whats happening :
I collect my data in a loop that runs in its own thread.
With a timebase index from 0 to 13 everything works fine. I get 8000 values with each call.
But when I get to index 14 the maximum number of samples I can request is 6553. When asking for more
ps2000_get_times_and_values() returns 0

The next test I ran was with timebase index 15. Here the limit turned out to be 3276.

For index 16 I was already able to predict the maximum number of samples to be 1638
Code: Select all
MaxSamples=2.147/(1/MaxDeviceSampleRate)*(2^TimeBaseIndex)
=2.147/((1/50000000)*(2^16))=1638


The constant 2.147 is simply the time when ps2000_ready() says "sampling has finished, go collect your data!"

I detected this behaviour when using no trigger on the single channel of my device, but I was also able to reproduce the problem with a normal Trigger-condition. Requesting 8000 Samples returns with 0 valid samples after ~2.147 seconds once your TimeBase index goes beyond 14.

Looks like there is an internal timeout in the ps2000-lib that causes this behaviour?
Is there a reason for having this timeout in your code?
(...and Yes, I know about the compatible streaming mode but I don't want to use it. )

Eberhard
wayoda
Active User
Active User
 
Posts: 11
Joined: Fri Aug 01, 2008 9:49 am
Location: Wuppertal/Germany

Sampling data long timebases times out to early? NO!

Postby wayoda » Fri Aug 29, 2008 12:57 pm

Hi,
I found my error. I requested the sample_times array with a time_unit of "nanoseconds". With timebase indices >=14 this overflows the long-values in the array after roughly 2.x seconds.

Eberhard
wayoda
Active User
Active User
 
Posts: 11
Joined: Fri Aug 01, 2008 9:49 am
Location: Wuppertal/Germany


Return to Linux

Who is online

Users browsing this forum: No registered users and 0 guests