HP (Hewlett-Packard) Drive Network Card User Manual


 
Using IVI with MATLAB®
61
11 Select File and Save IVI Configuration Store. Saving to the store may take
several moments.
12 Close the Test & Measurement Tool.
Generate an Instrument Wrapper
We will now automatically generate an instrument driver wrapper file (.mdd) so that
MATLAB can use the IVI driver.
At the MATLAB command prompt, type
makemid(‘dmm’);
The file
dmm.mdd
appears in the current directory window. This is the instrument
wrapper created by the
makemid
command. You may now use MATLAB to
communicate with your instrument through an IVI driver.
Note:
To help you learn the structure of a driver faster, MATLAB provides
autocompletion support. As you are typing your commands for a driver, press
the Tab key to get a selection of possible completions. You can also use the
command “get” to see a list of possible properties and “methods” to get a list
of methods on the object. “methodsview” will give you a graphical display of
the methods also.
Configure and Control the Instrument
You can interact with the instrument by using the Test & Measurement Tool or the
MATLAB command line. We use the MATLAB command line here.
Note:
All MATLAB methods and properties are available at the command line.
Create an Instance of the Instrument
To create an instance of the instrument, type
myDmm = icdevice(‘dmm’);
Connect to the Instrument
Similar to the Initialize command in most ADEs, the Connect command in MATLAB
initializes the instrument. The instrument will be initialized with the properties you
specified using the Test & Measurement Tool. Type
connect(myDmm);
Configure the Instrument
To set a range of 1.5 volts and resolution of 0.001 volts, type
myDmm.Range = 1.5;
myDmm.Resolution = 0.001;