ps500a Max Memory Segments

Post your MATLAB discussions here
Post Reply
j_morosi
Newbie
Posts: 0
Joined: Mon Oct 28, 2019 3:12 pm

ps500a Max Memory Segments

Post by j_morosi »

Hi all,

I'd need to optimize my Matlab application by correctly configuring memory segmentation on a 5243D oscilloscope. I use the 5243D Signal Generator to build a custom waveform which is used to trigger a frequency sweep performed by an external clock generator. The same signal is used to trigger the acquisition (5243D ChA) of 2500 samples per each frequency value.

Right now I'm able to configure the scope in RapidBlockMode to acquire data for a full frequency sweep (350 segments, 2500 samples each at 1 MS/s). Now, I'd like to acquire in the same way data coming from N different sweeps. My idea is to configure 350*N segments with 2500 PostTriggerSamples each, where N is approximately 1000 and then transfer the whole block to the PC.

I'm trying to figure out which is the maximum number of segments I can set up using a single channel. What is the correct way to call ps5000aGetMaxSegments function from Matlab?

Thanks for your help!
Regards,

Jacopo

NeilH
PICO STAFF
PICO STAFF
Posts: 265
Joined: Tue Jul 18, 2017 8:28 am

Re: ps500a Max Memory Segments

Post by NeilH »

Hi Jacopo

The maximum memory segments for the 5000D devices are 250000 for 8 bit mode and 125000 for 12 bit+ mode when using the SDK. https://www.picotech.com/oscilloscope/5000/picoscope-5000-specifications

How are you currently trying to call the ps5000aGetMaxSegments function in MATLAB?
Neil
Technical Support Engineer

j_morosi
Newbie
Posts: 0
Joined: Mon Oct 28, 2019 3:12 pm

Re: ps500a Max Memory Segments

Post by j_morosi »

Hi Neil,
thanks for your answer. To determine the maximum number of segments I'm calling the function GetMaxSegments as I found in .mdd driver:

Code: Select all

[status,maxSegments] = invoke(picoObj, 'ps5000aGetMaxSegments')
However, I get this error:

Code: Select all

Error using eval
Unrecognized function or variable 'maxSegments'.

Error in privateExecuteMCode (line 63)
    outForCustomFunction{i} = eval(output{i});

Error in instrgate (line 20)
   [varargout{1:nout}] = feval(varargin{:});

Error in icdevice/invoke (line 73)
        output = instrgate('privateExecuteMCode', code, obj, varargin, nargout);
So, which is the correct way to call the function? I also tried using directly calllib, but I'm not sure how it should be done.

Anyway, from the specs you linkend I understand that in 16bit mode the 5243D might be configured with 250000 segments. Is it correct? And, with these settings, what is the maximum number of samples per segment?

Thanks for your help.
Jacopo

NeilH
PICO STAFF
PICO STAFF
Posts: 265
Joined: Tue Jul 18, 2017 8:28 am

Re: ps500a Max Memory Segments

Post by NeilH »

Hi

I have fixed the bug with the ps5000aGetMaxSegments that causes the error you've been seeing so you can get the updated version of the addon from the addon manager or from github

If you set the number of segments to the maximum 250000 segments each segment would have 512 samples in it, which would be needed to share between each active channel. To calculate the number of samples per segment you would just need to divide the buffer memory by the number of segments.
Neil
Technical Support Engineer

j_morosi
Newbie
Posts: 0
Joined: Mon Oct 28, 2019 3:12 pm

Re: ps500a Max Memory Segments

Post by j_morosi »

Thanks Neil,
the updated addon works well!

Post Reply