Get latest streaming values

Post your .Net discussions here
Post Reply
BDR
User
User
Posts: 2
Joined: Tue Aug 18, 2015 3:23 pm

Get latest streaming values

Post by BDR »

GetStreamingLatestValues(handle) seems to randomly take longer than a few seconds and I end up missing data at random.

Has anyone ever come across this problem?

Hitesh

Re: Get latest streaming values

Post by Hitesh »

Hi BDR,

Are you referring to the GetStreamingLatestValues() function in the PicoScope 6000 Series C# Imports file or another PicoScope Series device?

It might be helpful to see the portion of code where you set up data buffers and start the streaming data collection in order to see what might be happening.

Are you using a USB 2.0 or USB 3.0 connection?

Which version of the ps6000.dll are you using and are you using a sleep in the data collection loop at all?

Regards,

BDR
User
User
Posts: 2
Joined: Tue Aug 18, 2015 3:23 pm

Re: Get latest streaming values

Post by BDR »

Yes, that is the code I am referring too, and yes it is for a pico 6000 series. I am writing in VB.net.

The data buffers are set up with the maximum amount of memory available, all 100M points, both app / driver buffers and data buffers. (maybe this is the cause of the inefficiency?)

There is a bit of time that passes between the code starting the stream and finally when I collect the data. This is no more than 1-2 milliseconds. I will try placing some of this code in another location to remove the delay and get back to you.

I am using a USB3 connection. My sample rate isn't very high (9.8MS/s) and USB2 would still maintain the necessary speed. I will eventually switch to wireless, as I may have a solution in this regard.

I have the PicoSDK_64_10.6.10.22 installed.

I do have a sleep in the loop. I just use Sleep(5). I have tried removing it and it still gets caught up in that loop longer than normal.

Hitesh

Re: Get latest streaming values

Post by Hitesh »

Hi BDR,

Try reducing the size of the data buffers as having such a large set of data buffers is probably not efficient.

Your data buffer size should be set so that it is large enough to accommodate the number of samples that would be collected in one iteration of the loop with the sampling interval that is set. You may wish to try a data buffer size in the region of 500,000 to 1,000,000 samples.

Are you implementing a callback Delegate function in your VB .NET code or using the ps6000Wrap.dll to handle the copying of data from your driver buffers to temporary application buffers?

Once data has been copied into the application buffers in the callback, it should be processed/copied elsewhere as required.

Regards,

BDR
User
User
Posts: 2
Joined: Tue Aug 18, 2015 3:23 pm

Re: Get latest streaming values

Post by BDR »

I will try reducing the size of the buffers. Is there any optimum efficiency table ever created? If not, that is okay, I will figure it out.

I am using the ps6000Wrap.dll to grab the data from the buffers. I do use the buffer to do some processing with. (I figured it was fast enough). I copy the buffer to run multiple threads for other measurements at the same time. I may be memory restricted making another copy, but I will also try this.

Thanks for these helpful tips. I will get back to you once I have tested this.

BDR
User
User
Posts: 2
Joined: Tue Aug 18, 2015 3:23 pm

Re: Get latest streaming values

Post by BDR »

Everything seems to have worked out.

I will have to simply play with the buffer size to optimize the performance depending on the sample rate chosen.

Hitesh

Re: Get latest streaming values

Post by Hitesh »

Hi BDR,

Thanks for posting back with an update.

Regards,

Post Reply