Hey guys,
I'm trying to control my DS1054Z in MATLAB using its IVI drivers. Unfortunately I am able to acquire 1200 points at the most. When invoking IviScope_ConfigureAcquisitionRecord with a larger value for MinNumPts "Invalid Input" is dispalyed on the oscilloscope's screen and the waveform acquisition won't start, returning a "Not a valid configuration" error in MATLAB.
It's my understanding that 1200 is the number of points displayed on the oscilloscope screen, and that's all I'm getting from the oscilloscope with my code. Does anyone know if it's possible to acquire from the oscilloscope memory by using IVI drivers? Or it is only possibile by using SCPI command / specific drivers?
My script for convenience:
scope = icdevice('rigol_IVI.mdd', 'Rigol')
connect(scope)
%%%% Channel 1 %%%%
Range = 1;
Offset = 0.0;
Coupling = 0;
Enabled = true;
Probe_attenuation = 1;
invoke(scope.Configurationchannel,'configurechannel',"CHAN1",Range,Offset,Coupling,Probe_attenuation,Enabled)
Input_impedance = 1000000
Max_frequency_hertz = 50000000
invoke(scope.Configurationchannel,'configurechancharacteristics',"CHAN1",Input_impedance,Max_frequency_hertz)
%%%% Channel 2 %%%%
Range = 1;
Offset = 0.0;
Coupling = 0;
Enabled = true;
Probe_attenuation = 1;
invoke(scope.Configurationchannel,'configurechannel',"CHAN2",Range,Offset,Coupling,Probe_attenuation,Enabled)
Input_impedance = 1000000
Max_frequency_hertz = 50000000
invoke(scope.Configurationchannel,'configurechancharacteristics',"CHAN2",Input_impedance,Max_frequency_hertz)
%%%% Acq settings %%%%
Acquisition_type = 0;
invoke(scope.Configurationacquisition,'configureacquisitiontype',Acquisition_type)
Time_per_record_s = 0.0008
Minimum_record_len = 5000
Acquisition_start = 0
% getting "invalid input" on oscilloscope screen on this invoke if Minimum_record_len > 1200
invoke(scope.Configurationacquisition,'configureacquisitionrecord',Time_per_record_s, Minimum_record_len, Acquisition_start)
%%%% Trigger %%%%
Trigger_type = 1
Trigger_holdoff_s = 0
Trigger_coupling = 1
invoke(scope.Configurationtriggerbaseconfigure,'configuretrigger',Trigger_type,Trigger_holdoff_s)
invoke(scope.Configurationtriggerbaseconfigure,'configuretriggercoupling',Trigger_coupling)
Trigger_source = 'CHAN2'
Trigger_lvl_v = 0.05
Trigger_slope = 1 % positive
invoke(scope.Configurationtriggeredgetrigger,'configureedgetriggersource',Trigger_source,Trigger_lvl_v,Trigger_slope)
%%%% acquisition %%%%
waveform_len = invoke(scope.Configurationconfigurationinformation, 'actualrecordlength')
waveform_array = zeros(waveform_len, 1);
% getting the matlab error here
[waveform_array, points, x0, dx] = invoke(scope.Waveformacquisition, 'readwaveform', 'CHAN1', waveform_len, 10000000, waveform_array)
plot(waveform_array)
disconnect(scope);
delete(scope);
clear scope;