Block mode measurements 5444D MSO

Post your MATLAB discussions here
Post Reply
den4952
Newbie
Posts: 1
Joined: Wed Oct 07, 2020 3:13 pm

Block mode measurements 5444D MSO

Post by den4952 »

Good day.

I have a question. Using Picoscope software I can reach 250 MS/s in 3 channel mode (5444D MSO). 1 data measurement block will be 0.2s with 50MS for each channel. It means 4ns which will be timebaseIndex = 2.

If I am trying to do the same measurements using MATLAB I can reach only 8ns which means 125 MS/s.


The code is:
PS5000aConfig;
%% Device connection
% Check if an Instrument session using the device object |ps5000aDeviceObj|
% is still open, and if so, disconnect if the User chooses 'Yes' when prompted.
if (exist('ps5000aDeviceObj', 'var') && ps5000aDeviceObj.isvalid && strcmp(ps5000aDeviceObj.status, 'open'))
openDevice = questionDialog(['Device object ps5000aDeviceObj has an open connection. ' ...
'Do you wish to close the connection and continue?'], ...
'Device Object Connection Open');
if (openDevice == PicoConstants.TRUE)
% Close connection to device.
disconnect(ps5000aDeviceObj);
delete(ps5000aDeviceObj);
else
% Exit script if User selects 'No'.
return;
end
end
% Create a device object.
ps5000aDeviceObj = icdevice('picotech_ps5000a_generic', '');
% Connect device object to hardware.
connect(ps5000aDeviceObj);
%%
[status.currentPowerSource] = invoke(ps5000aDeviceObj, 'ps5000aCurrentPowerSource');
status.setChannelStatus = PicoConstants.QUAD_SCOPE;
if (ps5000aDeviceObj.channelCount == PicoConstants.QUAD_SCOPE && status.currentPowerSource == PicoStatus.PICO_POWER_SUPPLY_CONNECTED)
[status.setChA] = invoke(ps5000aDeviceObj, 'ps5000aSetChannel', 0, 1, 1, 1, 0.0);
[status.setChB] = invoke(ps5000aDeviceObj, 'ps5000aSetChannel', 1, 1, 1, 1, 0.0);
end

if (ps5000aDeviceObj.channelCount == PicoConstants.QUAD_SCOPE && status.currentPowerSource == PicoStatus.PICO_POWER_SUPPLY_CONNECTED)

[status.setChC] = invoke(ps5000aDeviceObj, 'ps5000aSetChannel', 2, 1, 1, 1, 0.0);
[status.setChD] = invoke(ps5000aDeviceObj, 'ps5000aSetChannel', 3, 0, 1, 1, 0.0);

end

[status.setResolution, resolution] = invoke(ps5000aDeviceObj, 'ps5000aSetDeviceResolution', 8 );

status.getTimebase2 = PicoStatus.PICO_INVALID_TIMEBASE;
timebaseIndex = 2;

while (status.getTimebase2 == PicoStatus.PICO_INVALID_TIMEBASE)

[status.getTimebase2, timeIntervalNanoseconds, maxSamples] = invoke(ps5000aDeviceObj, ...
'ps5000aGetTimebase2', timebaseIndex, 0);

if (status.getTimebase2 == PicoStatus.PICO_OK)

break;

else

timebaseIndex = timebaseIndex + 1;

end

end


Could you please explain to me what am I doing wrong? Because with this code I can not reach Timebaseindex = 2 which is 4 ns. All the time Timebaseindex is switching to 3. However, using picoscope software I can easily measure 250Ms/s in 3 channel mode.....

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: Block mode measurements 5444D MSO

Post by hexamer »

EDIT: I have a new guess as to what's happening here. It's possible that when the MSO device is opened, some of the digital ports are enabled. These count as channels too, so would lower your max sampling frequency. If this is the case, you need to explicitly disable them with code like this:

https://github.com/picotech/picosdk-ps5 ... ple.m#L115 lines 115 through 137

Nevermind the explanation below. I see from https://github.com/picotech/picosdk-ps5 ... eneric.mdd that you are supposed to pass an integer representing the number of bits. However, I would check the return value to see if the call succeeded.

===

I don't program with the Matlab interface, but I would guess the issue is this line:

Code: Select all

[status.setResolution, resolution] = invoke(ps5000aDeviceObj, 'ps5000aSetDeviceResolution', 8 );
The valid constants passed to ps5000aSetDeviceResolution are:

PS5000A_DR_8BIT (0)
PS5000A_DR_12BIT (1)
PS5000A_DR_14BIT (2)
PS5000A_DR_15BIT (3)
PS5000A_DR_16BIT (4)

By passing the invalid value of 8, either the function returns an error (which you're not checking) and leaves the scope in a higher resolution mode, or the API is treating 8 as the highest possible resolution with the enabled channels.

If you pass 0 instead of 8, does that fix the issue?

Post Reply