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 » Mon Apr 16, 2018 12:26 pm

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
Site Admin
Site Admin
Posts: 2845
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Problems in capturing long data set

Post by Hitesh » Tue Apr 17, 2018 2:22 pm

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,
Hitesh

Technical Support Engineer

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

Re: Problems in capturing long data set

Post by MaximeV » Wed Apr 18, 2018 3:12 pm

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
Site Admin
Site Admin
Posts: 2845
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Problems in capturing long data set

Post by Hitesh » Fri Apr 20, 2018 7:51 am

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,
Hitesh

Technical Support Engineer

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

Re: Problems in capturing long data set

Post by MaximeV » Tue Apr 24, 2018 8:17 am

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

Post Reply