Application Note:
Application Note:
Using MATLAB
®
to Configure and
Control Tabors Wonder Wave
Series with IVI Drivers
Application Note
Alexey Farovich Senior Software Engineer
Tabor Electronics Ltd
PO Box 404, Tel Hanan, Israel
support@taborelec.com
Trademarks
MATLAB® is a trademark of The MathWorks, Inc.
NI-VISA is a trademark of National Instrument Corp.
NI-IVI is a trademark of National Instrument Corp.
March 5, 2007
www.taborelec.com
Table of Contents
1.0
Introduction ...............................................................................................
2
2.0
What is IVI? ...............................................................................................
3
3.0
Installing the requirement software ..................................................................
4
3.1
Installing the ww257x IVI driver ......................................................................
4
4.0
Using the ww257x IVI driver in MATLAB ............................................................
6
4.1
Example Script ..............................................................................................
7
5.0
Literature .....................................................................................................
10
1
Instrument Control with MATLAB®
1.0 Introduction
MATLAB® is a well known software environment for generating
waveforms for instruments, acquiring and analyzing measurements,
and building test systems. It can control and configure the Tabor
Wonder Wave Series of arbitrary waveform generators using
MATLABs
Instrument Control Toolbox
. Instrument Control Toolbox
supports IVI instrument drivers. This guide will show you how to
configure an IVI instrument driver, created by Tabor, to enable
MATLAB to communicate with Tabors Wonder Wave Series.
This application note is common to the entire Wonder Wave Series.
Model WW2572 was selected as an example. For all other models
you will have similar file names.
2.0 What is IVI?
The Interchangeable Virtual Instrument (IVI) specification provides a
standard for instrument drivers that address the performance issues
demanded by test system developers and provides a robust
framework for interchanging instruments.
IVI was developed to address problems test software developers
faced when writing code to programmatically communicate with
their instruments. Specifically, each instrument in their system
required a different set of commands to perform a specific action,
with no simple, standardized communication protocol in place to
program their instruments. Companies wasted valuable time and
money training their developers to write software for instruments.
Moreover, when instruments were upgraded, developers could not
reuse the software; they often had to learn a new protocol or a
different set of commands.
The IVI specification subdivides instruments into classes such as
digital multimeters or oscilloscopes. They then create a specification
for that class based on the most common features and functionality
of the most popular instruments within that class. The IVI
Foundation, the standards body overseeing the development of
these specs, has already defined specifications for eight instrument
classes. The table below provides a list of all these classes.
If you are developing test systems or software that communicates
with instruments, IVI can provide you with many benefits. IVI is not
limited to one instrument manufacturer or one type of
communication bus (e.g., GPIB, VXI, or computer-based) and
therefore does not limit your choice of instrument.
Instrument Control with MATLAB®
2
The IVI Foundation provides a comprehensive online list of IVI
drivers at
www.ivifoundation.org/Drivers.htm
. This list provides
information on more than 100 IVI drivers available for download
from various instrument and software vendors Web sites.
3.0 Installing the required software
The ww257x IVI driver uses the NI-VISA for communication with the instrument and the NI-IVI
Compliance Package, therefore you need to install them first. The installing sequence is important:
first you need to install the NI-VISA and afterwards the NI-IVI Compliance Package.
NOTE: All the installations afore mentioned can be found both in the Tabor web site and on the
CD which is each of our instruments. You can also download the latest version directly from the
NI web site.
Use the following Links:
www.ni.com/visa
(download the full version of NI-VISA)
www.ni.com/ivi
(download the NI-IVI Compliance Package)
3.1 Installing the ww257x IVI driver
As was mentioned above, the installation program available on a CD that is supplied with the
instrument. Insert the CD to your CD drive and follow the instructions in the installer. You may
then verify the integrity of the installation of the ww257x IVI driver in the NI-VISA or the
MATLAB environment:
NI-VISA environment
To verify if the driver is installed properly, use the Measurement & Automation Explorer
(MAX). To run the MAX, select National Instruments>> Measurement & Automation
from the Start menu as seen below in Figure 1.
Figure 1 Finding the Measurement & Automation Explorer.
3
Instrument Control with MATLAB®
Figure 2 - Viewing the ww257x IVI driver in MAX.
MATLAB environment
To verify if the driver is installed properly, launch MATLAB and use the instrhwinfo
command. The instrhwinfo command takes an optional argument, which can be a type
of instrument driver. For example, for IVI drivers the argument is
driverinfo = instrhwinfo(
'ivi'
)
The output of the command is a structure with fields. The IVIRootPath field identifies
the main IVI root install path. The Modules field lists all of the IVI drivers that are
installed in the root path.
NOTE: MATLABs Instrument Control Toolbox now provides a graphical tool, called Test &
Measurement Tool, which allows you to detect, control, configure, and exchange data with
instruments without writing code. Execute the tmtool command to launch this tool. You
may use this tool to verify that an instrument driver is installed or to configure an
instrument. However, using this tool is beyond the scope of this application note.
Instrument Control with MATLAB®
4
4.0 Using the ww257x IVI driver in MATLAB
All MATLAB instrument drivers, regardless of whether they are stand-alone or wrap an underlying
manufacturer's driver, are used to instantiate an icdevice object in MATLAB. This object is
assigned to a MATLAB variable that has a set of properties and methods for communicating with
the instrument.
Some properties and methods are common across all objects independent of the driver type and
instrument model, for example, the driver name and connect/disconnect methods. In addition,
the object will have properties and methods that are unique to the instrument based on the
information in the driver. In the following example we will create an icdevice object and connect
to the instrument, which is connected to the computer through a GPIB interface. The GPIB
primary address is 6.
deviceObj = icdevice(
'tabor_ww257x.mdd'
,
'GPIB0::6::INSTR'
);
connect(deviceObj);
You can view some basic information about the icdevice object and the associated driver and
instrument by looking at the icdevice objects display.
display(deviceObj)
Instrument Device Object Using Driver : ww257x
Instrument Information
Type: Function
Generator
Manufacturer:
Tabor Electronics Ltd
Model:
TABOR WW257X Waveform Generator
Driver Information
DriverType: MATLAB
IVI
DriverName:
ww257x
DriverVersion: 1.0
Communication State
Status:
open
Most of the instrument functionality is typically contained below the root level of the object in
groups related to specific functionality. These groups are properties of the object and have their
own properties and functions. The following code examines the methods of the Configuration
group for this driver.
groupObj = get(deviceObj,
'Configuration'
);
methods(groupObj)
Driver specific methods for class icconfiguration:
con