How to check the scale of Math channel in agilent oscilloscope or tektronix oscilloscope

4 次查看(过去 30 天)
I am trying to adjust math scale using ivi drivers, I am not able to adjust it by coding ,can you provide me how to adjust vertical scale of math channel?

回答(1 个)

Garmit Pant
Garmit Pant 2023-9-12
Hello Raj,
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:
  1. 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'.
  2. 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.
  3. 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:
%Create an instance of the scope called myScope.
myScope = oscilloscope()
%If multiple resources are available, use your VISA utility to verify the correct resource and set it.
set(myScope, 'Resource', 'TCPIP0::a-m6104a-004598::inst0::INSTR');
%Connect to the scope.
connect(myScope);
%Automatically configure the scope based on the input signal.
autoSetup(myScope);
%Configure the oscilloscope.
% Set the acquisition time to 0.01 second.
set(myScope, 'AcquisitionTime', 0.01);
% Set the acquisition to collect 2000 data points.
set(myScope, 'WaveformLength', 2000);
% Set the trigger mode to normal.
set(myScope, 'TriggerMode', 'normal');
% Set the trigger level to 0.1 volt.
set(myScope, 'TriggerLevel', 0.1);
% Enable channel 1.
enableChannel(myScope, 'Channel1');
% Set the vertical coupling to AC.
setVerticalCoupling (myScope, 'Channel1', 'AC');
% Set the vertical range to 5.0.
setVerticalRange (myScope, 'Channel1', 5.0);
% Acquire the waveform.
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:
  1. Guide for the “oscilloscope” function- https://in.mathworks.com/help/instrument/oscilloscope.html
  2. How to configure an oscilloscope channel - https://in.mathworks.com/help/instrument/instrument.oscilloscope.configurechannel.html
  3. 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!
  1 个评论
RAJ KISHORE LAGURI
RAJ KISHORE LAGURI 2023-9-25
Hi, Math channel is used for doing mathematical analysis of waveform. The solution provided by you is only for adjusting channel 1 0r 2. I need to do operations using Math operation and see the result in the oscilloscope with scale adjustments.

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by