Improving USB transfer rate

Post any questions you may have about our current range of oscilloscopes
Post Reply
Yaniv
Newbie
Posts: 1
Joined: Sun Feb 15, 2009 5:56 pm

Improving USB transfer rate

Post by Yaniv »

Hello,

I have successfully grabbed video data (pal, ntsc) using picoscope 5000.

Everything would be great with one problem:
ps5000GetValues returns the data only after 900 milli Seconds,
when asked to return 10,000,000 samples.

By simple calculation I can see that the data transfer rate is around 22MB,
Whereas USB2 can transfer rate is up to 50MB/s.

Is there a way to get a better results (chaging mode maybe)?
The scope sends data as two bytes for each sample, can this be changed?

I am working on blocking mode,

Below is the code I use to initialize the scope,
Please tell me if there is any way to improve this...

Code: Select all


  { set up for data collection }
  Result := ps5000SetEts(ps5000_handle, 0, 0, 0, sampleTime);
  if Result <> 0 then
  begin
    FGrabStatus := susError;
    Exit;
  end;

  try
    { set Channel A on and Channel B off }
    ps5000SetChannel(ps5000_handle, 0, 1{true}, 1{DC}, VoltageRange);
    ps5000SetChannel(ps5000_handle, 1, 0{false}, 1{DC}, VoltageRange);
    { set up Channel A's buffers }
    ps5000SetDataBuffers(ps5000_handle, 0, @channelA[0], nil, FsmplsNum);
    { clear trigger mode }
    ps5000SetTriggerChannelProperties(ps5000_handle, nil, 0, 0, 0);


    FSampleReady.ResetEvent;
    Result := ps5000RunBlock(ps5000_handle, 0, FsmplsNum, TIMEBASE, 1, timeIndisposed, 0, @CallbackBlock, @FSampleReady);
    if Result <> 0 then
    begin
      FGrabStatus := susError;
      Exit;
    end;

    // Wait for sampling to finish.
    wr := FSampleReady.WaitFor(15000);
    if wr <> wrSignaled then
    begin
      FGrabStatus := susError;
      Exit;
    end;

    {Get the results}
    ps5000GetValues(ps5000_handle, 0, FsmplsNum, 1, 0, 0, overflow);
  finally
    ps5000Stop(ps5000_handle);

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hi

The highest data transfer rate that we have mangaged to achieve here is around 30 MB/s.

There are overheads due to bit stuffing and start-of-frames for example.

The rate achieved will also depend on the performance of the USB controller and whether there are any other devices connected to the hub.

Hope this helps

Robin

Post Reply