Test and Measurement Forum

Unable to increase the number of memory segments on PS4824

Post your MATLAB discussions here

Unable to increase the number of memory segments on PS4824

Postby Lilian » Fri Jun 05, 2015 8:42 am

Hello

I'm using a PS4824 with MatLab and i would like to set the number of memory segment at 512 in order to get 300+ measurements.
However, when there are more than 128 segments, i have an error with the fonction 'ps4000aGetTimebase2' and the corresponding status is 'PICO_TOO_MANY_SAMPLES’.

I can't figure out why this occur and i would apreciate some help.

thank you :)
Lilian
Newbie
 
Posts: 0
Joined: Fri Jun 05, 2015 8:33 am

Re: Unable to increase the number of memory segments on PS48

Postby Hitesh » Fri Jun 05, 2015 10:29 am

Hi Lilian,

The ps4000aMemorySegments function will return the maximum number of samples available per segment (independent of the number of channels enabled).

You can use this information to work out how many samples you can request per waveform and accordingly use this with the ps4000aGetTimebase2 function.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Unable to increase the number of memory segments on PS48

Postby Lilian » Mon Jun 08, 2015 9:40 am

Hello

I saw on the programer's guide that we can set the number of samples in 'ps400aGetTimebase2' but i cannot do it on matlab.
i just need 40k samples per waves whereas maxSamples=262048 with 512 segments, 2 channels and timebase=1.

i tried this line
Code: Select all
[status.getTimebase2, timeIntNs, maxSamples] = invoke(ps4000aDeviceObj, 'ps4000aGetTimebase2', timebase,40000,0);

but MatLab return 'PICO_SEGMENT_OUT_OF_RANGE' , wich is normal if this line said that 40000 segments are required.
Lilian
Newbie
 
Posts: 0
Joined: Fri Jun 05, 2015 8:33 am

Re: Unable to increase the number of memory segments on PS48

Postby Hitesh » Mon Jun 08, 2015 1:57 pm

Hi Lilian,

You will need to set the numPreTriggerSamples and numPostTriggerSamples using the 'set' function before calling the ps4000aGetTimebase2 function. E.g.

Code: Select all
set(ps4000aDeviceObj, 'numPostTriggerSamples', 1000000);


The ps4000aGetTimebase2 function will use the sum of these two values for the noSamples parameter required by the underlying driver function (defined in the Programmer's Guide).

Hope this helps,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Unable to increase the number of memory segments on PS48

Postby Lilian » Mon Jun 08, 2015 2:06 pm

Hi Hitesh

this seems working. :D

thank you very much for your help!

Lilian
Lilian
Newbie
 
Posts: 0
Joined: Fri Jun 05, 2015 8:33 am


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests