Problems in capturing long data set

Post your MATLAB discussions here
Post Reply
MaximeV
Newbie
Posts: 0
Joined: Mon Apr 16, 2018 11:24 am

Problems in capturing long data set

Post by MaximeV »

Hi !

I come in this forum cause I have a problem using Matlab r2018a and a PicoScope 4224. I'm gonna try to explain it as simply as possible.

Actually, I want to capture data using the streaming mode. So for this, I'm using this code that I've found on github (https://github.com/picotech/picosdk-ps4 ... _Example.m).

The problem is that this code permit to capture data for only 2s if we don't change parameters and me I want to capture data for 15min more or less.

To do this, I've changed :

Code: Select all

set(ps4000DeviceObj, 'numPostTriggerSamples', 2000000);
into :

Code: Select all

set(ps4000DeviceObj, 'numPostTriggerSamples', 60000000);
in order to test it for only 1min at first.

But every time, from approximately 19s, the program stops and I have this error :
Error using icgroup/invoke (line 95)
ps4000GetStreamingLatestValues: Status code : 268435464. Please refer to the PicoStatus.m file.

Error in pico4000 (line 322)
status.getStreamingLatestValues = invoke(streamingGroupObj, 'getStreamingLatestValues');
And I really don't understand why it stops and displays this error.

If anybody have an idea, i will be very grateful.


____________________________________________________
Processor : Intel Core i7-6700HQ @ 2.60GHz
Memory (RAM) : 8.00 Go
W10 64 bits

Hitesh

Re: Problems in capturing long data set

Post by Hitesh »

Hi MaximeV,

If you convert the status code to a hexadecimal number, this gives 0x10000008 (PICO_DEVICE_MEMORY_OVERFLOW) indicating that the device memory has overflowed.

What sampling rate are you using and how large are the overview and application buffers? Its possible that they might not be large enough for the data being returned on each iteration of the loop.

Regards,

MaximeV
Newbie
Posts: 0
Joined: Mon Apr 16, 2018 11:24 am

Re: Problems in capturing long data set

Post by MaximeV »

Hi Hitesh !

Thank you for your reply.

Indeed, the problems seemed that the buffers wasn't large enough. They were a size of 250.000 and we have increased them to a more relevant size and it works for our test of 1min.

But it doesn't work when we want to do loooooong acquisition of data, even if we increase the size of the buffer. Well, it might works but it takes very long times.

We have a sampling rate of 1MS/s, we set the buffer size to 10e+9 and we want to collect datas for 15min, that is we set this like this :

Code: Select all

set(ps4000DeviceObj, 'numPostTriggerSamples', 900000000);
But it seems that MatLab doesn't like vectors with too much rows.

What do you think we can do to collect data for long time (15min at first and maybe later 1h) ?

Regards.

MV

Hitesh

Re: Problems in capturing long data set

Post by Hitesh »

Hi MV,

For a long data capture at 1 MS/s, try setting the overview buffer size to something like 500,000 or 1,000,000. Depending on the rate being used, setting the overview buffer with a large size can slow down the streaming data collection.

Setting the number of post trigger samples to a very large number can cause issues as well, as the underlying ps4000.dll shared library stores the data samples. With each sample being 2 bytes (16-bits), 900000000 samples will be about 1.67 GB.

What you can try doing is set the number of post-trigger samples to a much smaller number and setting the autoStop property in the Streaming group to 0. You can then either choose to monitor the total samples collected and stop data collection when this is reached or use a timer to exit the data collection loop after a period of time.

Hope this helps,

MaximeV
Newbie
Posts: 0
Joined: Mon Apr 16, 2018 11:24 am

Re: Problems in capturing long data set

Post by MaximeV »

Hi Hitesh,

Thank you for your replies. They have helped us a lot in understanding the code.

I think that we managed to do what we wanted.

Thank you !

MV

student
User
User
Posts: 2
Joined: Fri Dec 04, 2020 11:14 am

Re: Problems in capturing long data set

Post by student »

Hello,

I am also trying to make long data captures in Streaming Mode using Matlab and a PicoScope 4224.
The longest data capture I can take is about 1 minute long with a sampling rate of 10MS/s.
After that time the same error occurs. I tried many different buffersizes and sampling rates. The lower the sampling rate, the longer is the time before the programm returns the error.

Has anyone succeeded in taking extremely long/ indefinitely long data captures using Matlab (with a sampling rate of 9-10 MS/s)?

Help is greatly appreciated.

student

2353668408@qq.com
Newbie
Posts: 0
Joined: Thu Oct 13, 2022 7:58 am

Re: Problems in capturing long data set

Post by 2353668408@qq.com »

Have you solved the problem?Can you tell me how to collect for a long time? thank you :D

Post Reply