Test and Measurement Forum

Runblock function occ

Post any questions you may have about our current range of oscilloscopes

Runblock function occ

Postby rbreesems » Tue Sep 13, 2011 2:26 pm

I have a Picoscope 4227 that I have written a custom C# application for that is based off of the C# example from your PS4000SDK (R10_1_0_17). I am using Visual Studio 2008.

I am running the scope in rapid block mode without aggregation and asking the scope to capture 10 waveforms in a single call to RunBlock. Trigger events happen about every 100 us, and my application simply collects the scope data, processes it, and saves results.

The application has run successfully for days at a time collecting data. The problem that I am having is that very occasionally, the call to the 'Runblock' function simply hangs (I always start the application in Visual Studio so that I can break the problem and see where the code is if a problem occurs). The call to 'RunBlock' is as follows, once the program is running the various variables passed to RunBlock never change (the number of preSamples, postSamples, etc).

Code: Select all
// Run the rapid block capture
       int timeIndisposed;
       _ready = false;

       _callbackDelegate = BlockCallback;
       Imports.RunBlock(_handle,
                   (int)g_preSamples,
                   (int)g_postSamples,
                   _timebase,
                   _oversample,
                   out timeIndisposed,
                   0,
                   _callbackDelegate,
                   IntPtr.Zero);


The 'BlockCallBack' function simply does this:

Code: Select all
void BlockCallback(short handle, short status, IntPtr pVoid)
    {
      // flag to say done reading data
      _ready = true;
    }


Question:

Why would the call to the "RunBlock" function hang? It seems that it should simply configure the scope, and then return. I can understand if the callback is never called (ie. the scope does not receive triggering from the data source), but why would the 'RunBlock' function simply hang? I know it is hanging in the 'RunBlock' call because when my application freezes, I use Visual Studio to break program execution and the code is sitting at the 'RunBlock' call.

I have no idea what triggers this behavior. This just seems to happen randomly, and can happen once the scope has successfully captured lots of data already.
rbreesems
Newbie
 
Posts: 0
Joined: Tue Sep 13, 2011 2:06 pm

Re: Runblock function occ

Postby Martyn » Fri Sep 16, 2011 12:05 pm

When this occurs are you able to successfully restart the application or do you have to unplug the 4227 or restart the PC ?
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Runblock function occ

Postby rbreesems » Sun Sep 18, 2011 1:49 pm

Martyn wrote:When this occurs are you able to successfully restart the application or do you have to unplug the 4227 or restart the PC ?


Thanks for the reply. We have to restart the application, but do not have to unplug the Picoscope or restart Windows.

I guess that I do not understand why the Runblock function does not have some sort of timeout in it so that a perpetual hang would never occur. Right now, I have no way to work around this problem except to cross my fingers and hope that it does not hang up.
rbreesems
Newbie
 
Posts: 0
Joined: Tue Sep 13, 2011 2:06 pm

Re: Runblock function occ

Postby Martyn » Mon Sep 19, 2011 8:05 am

Can I ask you to contact the support team at support@picotech.com with information on exactly how you have setup the channels, triggering and rapid block collection.

Kind regards,
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2339
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Runblock function occ

Postby rbreesems » Wed Sep 21, 2011 8:43 pm

Martyn wrote:Can I ask you to contact the support team at support@picotech.com with information on exactly how you have setup the channels, triggering and rapid block collection.

Kind regards,


Thanks, I will do that if continues to be a problem. Right now, it happens infrequently enough that we can tolerate it, but if that changes, I will contact the support team will all of the details. There is some intense data collection planned for the next couple of weeks, will know more after that.
rbreesems
Newbie
 
Posts: 0
Joined: Tue Sep 13, 2011 2:06 pm


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests