PicoScope 4224 Streaming works 50% of the time

Post your C and C++ discussions here
Post Reply
gmorganVA
Newbie
Posts: 0
Joined: Mon Apr 22, 2013 1:29 pm

PicoScope 4224 Streaming works 50% of the time

Post by gmorganVA »

Starting with the sample code supplied with the PicoScope SDK I customized the "immediate streaming" and "triggered streaming" for my application. After modification I noticed that just about every other time (50% or maybe a little greater than 50%) that I start streaming I get no data from the scope. The only reliable way to restore streaming is to exit the program completely and enter again.

I need to look into closing the handle the scope and opening it (and reinitializing everything) to see it that is a workaround but for now I just modified the application to exit completely after streaming and then run it again. This is kinda a clunky workaround so I'd like to get this fixed. One of the things I'm going to look into is seeing if I get an error code from the ps4000RunStreaming or ps4000GetStreamingLatestValues function calls.

FYI, I have the following versions:
Picoscope 6 version: 6.6.57.20
Driver verson: 1.1.0.288 (as reported by the PicoScope6 application about dialog and my test application)
Firmware: 1.0.5.0 0.6.12.0

gmorganVA
Newbie
Posts: 0
Joined: Mon Apr 22, 2013 1:29 pm

Re: PicoScope 4224 Streaming works 50% of the time

Post by gmorganVA »

I did some additional checking and it appears that the first time I try to do streaming after it is successful I get a scope not ready error. After this point I don't get any errors from the API calls related to streaming data but I also don't get any data. I do get a few busy errors from the GetLatestValues function from time to time while streaming but I assume this is normal. My sample rate is pretty low and the sample data (when data is flowing) looks good so I don't think it is a matter of getting behind.

gmorganVA
Newbie
Posts: 0
Joined: Mon Apr 22, 2013 1:29 pm

Re: PicoScope 4224 Streaming works 50% of the time

Post by gmorganVA »

I did some additional investigation and discovered the following: The first time I run my customized example program then streaming usually works. I've changed the code so that the memory for the sample buffers are only allocated when the program starts and then reused for each streaming run. They are not deallocated until the program terminates. I added some debug prints to see if the pointers are getting stepped on but they seem to be fine throughout the program. I have been checking the return values from ps4000RunStreaming() and ps4000GetLatestValues() (and a lot of the other API calls) and I noticed that the 2nd time I try to run streaming I get a PICO_NOT_RESPONDING error from the ps4000GetLatestValues() call. I tried only setting the data buffers once in the program but I started getting a PICO_INVALID_BUFFER error message so I changed the code to set the buffers before calling ps4000RunStreaming each time. (but I'm still only allocating the buffers in the beginning of the program and deallocating right before exit) I modified the code so that when I get the PICO_NOT_RESPONDING I do a ps4000Stop, a ps4000CloseUnit, a ps4000OpenUnit and then reinitialize the scope. When I do this I don't have to exit the program and re-enter it to stream multiple times. I do think that this workaround is not the best and would like to track down the real issue. I still think there may be some race condition with the ps4000Stop or something. Looking forward to finding a solution.

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

Re: PicoScope 4224 Streaming works 50% of the time

Post by Martyn »

I have carried out some testing and, although I am not getting PICO_NOT_RESPONDING and PICO_INVALID_BUFFER status messages, I am getting no data returned 50% of the time once I let the streaming run for an extended period before stopping and starting it.

I will carry out some more tests and report back later.
Martyn
Technical Support Manager

gmorganVA
Newbie
Posts: 0
Joined: Mon Apr 22, 2013 1:29 pm

Re: PicoScope 4224 Streaming works 50% of the time

Post by gmorganVA »

I figured I'd give you a little more information about my environment in case it helps narrow the problem. We have the PicoScope attached to a laptop which is running Windows 7 64-bit with Service Pack 1. We tried running my application with a version of PicoScope software that is earlier than 6.6.57.20 but we get frequent data underuns when using the previous version (not an issue with 6.6.57.20).

I'm wondering if you think the latest release candidate might have some fixes that would possibly improve things for continuous streaming?

Thanks for looking into this problem. Please let me know if there is any other information that you think would be relevant to tracking down the cause.

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

Re: PicoScope 4224 Streaming works 50% of the time

Post by Martyn »

We are still looking into this and have still not managed to resolve it, including with the driver from the latest build.
Martyn
Technical Support Manager

Post Reply