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)
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.....
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:
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:
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?