I understand that you are trying to adjust the vertical math scale of an oscilloscope using IVI drivers.
This can be done using the function “oscilloscope” of the Instrument Control Toolbox.
The function “oscilloscope” creates Quick-Control Oscilloscope object that can be used to control oscilloscopes using IVI-C drivers. Various functions of the Quick-Control Oscilloscope can be used to control the vertical math channel of the oscilloscope. They are listed below:
- setVerticalCoupling – Specifies how the oscilloscope couples the input signal for the selected channel name as a MATLAB character vector. Valid values are 'AC', 'DC', and 'GND'.
- setVerticalOffset - Specifies location of the center of the range for the selected channel name as a MATLAB character vector. For example, to acquire a sine wave that spans between 0.0 and 10.0 volts, set this attribute to 5.0 volts.
- setVerticalRange - Specifies the absolute value of the input range the oscilloscope can acquire for the selected channel name as a MATLAB character vector. The units are volts.
You can follow the following example to configure and acquire a waveform from an IVI-C class oscilloscope:
set(myScope, 'Resource', 'TCPIP0::a-m6104a-004598::inst0::INSTR');
set(myScope, 'AcquisitionTime', 0.01);
set(myScope, 'WaveformLength', 2000);
set(myScope, 'TriggerMode', 'normal');
set(myScope, 'TriggerLevel', 0.1);
enableChannel(myScope, 'Channel1');
setVerticalCoupling (myScope, 'Channel1', 'AC');
setVerticalRange (myScope, 'Channel1', 5.0);
waveformArray = readWaveform(myScope);
This example works with IVI-C class oscilloscopes and Tektronix oscilloscopes. You would need to install the “Instrument Control Toolbox Support Package for National Instruments VISA and ICP Interfaces” to use these functions. You can follow the following instruction list to install the support package:
Please refer to the following MathWorks Documentation as well:
- Guide for the “oscilloscope” function- https://in.mathworks.com/help/instrument/oscilloscope.html
- How to configure an oscilloscope channel - https://in.mathworks.com/help/instrument/instrument.oscilloscope.configurechannel.html
- Quick-Control Oscilloscope Requirements - https://in.mathworks.com/help/instrument/quick-control-oscilloscope-requirements.html
I hope you find the above explanation and suggestions useful!