I use Windows 7 64 bit, Matlab R2017b, a Picoscope 5444B and stream data from 3 channels with 1 MS/s each.
The problem is that after a time of about 6-7 minutes the stream freezes / does not deliver any more data.
I built my script using the PS5000A_ID_Streaming_Example.m. During recording, I save the data to the hard disk and erase it from memory. Even if I do not read the data from the buffer, no new data is delivered after 6-7 minutes. This problem doesn't occure when streaming at lower rates like 100 kS/s. The parameters I use to create the buffers and make the picoscope ready to start:
sampleCount = 1e7;
set(handles.ps5000a.DeviceObj, 'streamingInterval', 1e6);
set(handles.ps5000a.DeviceObj, 'numPostTriggerSamples', 3600*1e6); % I press "Stop" manually within an hour
downSampleRatio = 1;
finalBufferLength = round(1.5* 3* sampleCount);
What I have observed is that the memory usage is constantly increasing during recording (see screenshot). I can only release it again as soon as I prepare the picoscope again for a streaming mode.
I hope you can help me or give me hints where the problem might lie. I will be happy to provide further information if required.
when I run the PicoScope 6.12, I do not see a problem at all, but it does not record for such a long time when at 1MS/s (The problem in MATLAB occurs after several minutes).
MATLAB is still responsive (while busy, I can pause to enter commands) and memory returns:
Maximum possible array: 13682 MB (1.435e+10 bytes) *
Memory available for all arrays: 13682 MB (1.435e+10 bytes) *
Memory used by MATLAB: 5374 MB (5.636e+09 bytes)
Physical Memory (RAM): 12206 MB (1.280e+10 bytes)
Further, I found out that when no data is passed into the buffer anymore, the picoscope returns PicoConstants.FALSE when called invoke(handles.ps5000a.DeviceObj, 'isReady')
Can this still be an array managing problem with MATLAB, when picoscope returns "not ready"?
PS: I found out that at a rate of 1MS/s the data collection freezes at exactly 382,788,160 collected data samples.