Main Content

oscilloscope

Connection to Quick-Control Oscilloscope instrument

Description

The Quick-Control Oscilloscope can be used for any oscilloscope that uses VISA and an underlying IVI-C driver. You can also use it for Tektronix® oscilloscopes. You do not have to directly deal with the underlying driver.

For information on the prerequisites for using oscilloscope, see Quick-Control Oscilloscope Requirements.

Creation

Description

myScope = oscilloscope creates an object to connect to your oscilloscope. To connect to the oscilloscope specified by myScope, use connect(myScope).

example

myScope = oscilloscope(resource) creates a connection to the oscilloscope with the specified resource string.

myScope = oscilloscope(resource,driver) creates a connection to the oscilloscope with the specified resource string and driver.

Input Arguments

expand all

Oscilloscope identifier, specified as a character vector or string scalar.

Example: myScope = oscilloscope('TCPIP0::a-m6104a-004598::inst0::INSTR') creates a connection to the oscilloscope with the resource string 'TCPIP0::a-m6104a-004598::inst0::INSTR'.

Data Types: char | string

Oscilloscope driver, specified as a character vector or string scalar.

Example: myScope = oscilloscope('TCPIP0::a-m6104a-004598::inst0::INSTR','tektronix') creates a connection to the oscilloscope using the 'tektronix' driver.

Data Types: char | string

Properties

expand all

Instrument Settings

Time from trigger event to first point in waveform record, specified as a number in seconds. If positive, the first point in the waveform occurs after the trigger. If negative, the first point in the waveform occurs before the trigger.

Data Types: double

Acquisition time value, specified as a positive and finite number in seconds. Used to control the time that corresponds to the record length.

Data Types: double

This property is read-only.

Available channel names, specified as a cell array of character vectors.

Data Types: cell

This property is read-only.

Currently enabled channel names, specified as a cell array of character vectors.

Data Types: cell

Single sweep mode, specified as 'off' or 'on'. If the value is 'on', the oscilloscope stops acquiring after one acquisition is complete.

Data Types: char | string

Timeout value, specified as a positive number.

Data Types: double

Number of points acquired by the oscilloscope for the waveform, specified as a positive number.

Data Types: double

Trigger Settings

Voltage threshold for the trigger control, specified as a number in volts.

Data Types: double

Source that the oscilloscope monitors for a trigger, specified as a character vector. It can be channel name or other values.

Data Types: char | string

Trigger slope value, specified as 'falling' or 'rising'.

Data Types: char | string

Triggering behavior of the oscilloscope in the absence of the configured trigger, specified as 'normal' or 'auto'. If the value is 'normal', the oscilloscope waits until the trigger the user specifies occurs. If the value is 'auto', the oscilloscope automatically triggers if the configured trigger does not occur within the oscilloscope’s timeout period.

Data Types: char | string

Communication Properties

This property is read-only.

Communication status, specified as 'open' or 'closed'.

Data Types: char | string

Oscilloscope identifier, specified as a character vector.

Data Types: char | string

Driver configuration, specified as 'auto' or 'manual'. If set to 'auto', you do not have to set a driver name before connecting to an instrument. If set to 'manual', a driver name must be provided before connecting.

Data Types: char | string

Oscilloscope driver, specified as a character vector. Use only if DriverDetectionMode is set to 'manual'. Use it to give driver name. Only use if driver name cannot be figured out programmatically.

Data Types: char | string

Object Functions

Use these object functions with any Quick-Control interface.

driversList of available instrument drivers for Quick-Control interfaces
resourcesList of available instrument resources for Quick-Control interfaces
connectConnect device object to instrument
disconnectDisconnect device object from instrument

Use these object functions with Quick-Control oscilloscopes.

configureChannelReturn or set specified oscilloscope control on selected channel
readWaveformReturns waveform displayed on scope

Examples

collapse all

Create an instance of the scope called myScope.

myScope = oscilloscope()

Discover available resources. A resource string is an identifier to the instrument. You need to set it before connecting to the instrument.

availableResources = resources(myScope)

If multiple resources are available, use your VISA utility to verify the correct resource and set it.

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. 
myScope.AcquisitionTime = 0.01;

% Set the acquisition to collect 2000 data points. 
myScope.WaveformLength = 2000;

% Set the trigger mode to normal. 
myScope.TriggerMode = 'normal';

% Set the trigger level to 0.1 volt. 
myScope.TriggerLevel = 0.1;

% Enable channel 1. 
enableChannel(myScope,'Channel1');

% Set the vertical coupling to AC. 
configureChannel(myScope,'Channel1','VerticalCoupling','AC');
     
% Set the vertical range to 5.0. 
configureChannel(myScope,'Channel1','VerticalRange',5.0);

Communicate with the instrument. For example, read a waveform.

% Acquire the waveform. 
waveformArray = readWaveform(myScope);

% Plot the waveform and assign labels for the plot. 
plot(waveformArray);
xlabel('Samples');
ylabel('Voltage');

Version History

Introduced in R2011b