Click or drag to resize

Creating a MATLAB Wrapper

With the release of MATLAB® classes in the R2009a release of MATLAB®, IVI-COM drivers can be represented in a very natural, hierarchical fashion in MATLAB. The MATLAB Instrument Control Toolbox™ allows MATLAB users to access both the instrument-specific and class-compliant interfaces exposed from any compliant IVI-COM driver. To fully integrate IVI-COM drivers with the MATLAB environment requires special MATLAB "wrapper" classes that encapsulate the COM programming details and expose a more natural and familiar interface to the MATLAB user. Nimbus can be instructed to automatically generate these wrapper classes for any IVI-COM driver by changing a single setting on the MATLAB Page of the IVI-COM driver Driver Settings Editor.

Requirements for Using MATLAB Wrapper Classes

In order to use the generated MATLAB classes, the end user system must meet the following requirements:

  1. MATLAB R2009a or later.

  2. MATLAB Instrument Control Toolbox

Note Note

The Nimbus driver developer does not need to have MATLAB installed in order to generate the MATLAB wrapper classes. Only end users developing with the wrappers need to meet the above requirements. Obviously, driver developers working without MATLAB have no way to test their MATLAB wrapper, so validation must be performed on a machine that also meets the above requirements.

Fundamentals of MATLAB Driver Wrappers

A MATLAB wrapper in Nimbus is a series of MATLAB M-files (.m) that define a set of MATLAB classes. These classes are arranged in a hierarchy that exactly matches the hierarchy of the underlying IVI-COM driver. One MATLAB class is generated in one .m file for each instrument-specific IVI-COM interface in the driver. MATLAB ships with pre-built classes for all of the IVI-defined instrument classes (e.g. IviDmm, IviSpecAn, IviScope, etc.), so Nimbus does not generate any .m files for IVI-defined interfaces. Rather, if a Nimbus driver supports an IVI-defined instrument class, the Nimbus-generated MATLAB wrapper will utilize object-oriented features in MATLAB to inherit from the appropriate pre-built IVI wrapper class. In this way, the MATLAB user has a consistent and natural way to access all of the functionality in a Nimbus IVI driver -- class-compliant and instrument-specific.

The hierarchy of methods and properties in a MATLAB wrapper is established by the hierarchy of .m files in special folders that MATLAB knows to search on an end-user system. When MATLAB wrapper generation is enabled via the MATLAB Page of the IVI-COM driver Driver Settings Editor, Nimbus not only generates the appropriate MATLAB classes and .m files, but it also modifies the driver installer so that the .m files are deployed on the end user system where MATLAB expects these classes to be. Specifically, the driver installer will deploy the .m files in the following folder:


For example, a typical end user system would find the MATLAB wrapper files in the following folder:

C:\Program Files\IVI Foundation\IVI\Components\MATLAB\+instrument\+driver\+Acme4321

Download a complete CHM version of this documentation here.