Runblock function occ

Post any questions you may have about our current range of oscilloscopes
Post Reply
rbreesems
Newbie
Posts: 0
Joined: Tue Sep 13, 2011 2:06 pm

Runblock function occ

Post by rbreesems »

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.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Runblock function occ

Post by Martyn »

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 Support Manager

rbreesems
Newbie
Posts: 0
Joined: Tue Sep 13, 2011 2:06 pm

Re: Runblock function occ

Post by rbreesems »

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.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Runblock function occ

Post by Martyn »

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 Support Manager

rbreesems
Newbie
Posts: 0
Joined: Tue Sep 13, 2011 2:06 pm

Re: Runblock function occ

Post by rbreesems »

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.

Post Reply