| Contents | Index |
| On this page… |
|---|
Installing VXI plug&play Drivers Creating a MATLAB VXIplug&play Instrument Driver Constructing Device Objects Using a MATLAB VXIplug&play Instrument Driver |
The VXIplug&play driver particular to a piece of equipment is usually provided by the equipment manufacturer as either an installation disk or as a Web download. Once the driver is installed, you can determine whether the configuration is visible to MATLAB software by using the Test & Measurement Tool to view the current driver installations. Open the tool by typing:
tmtool
Expand the Instrument Drivers node and click VXIplug&play Drivers. Click the Scan button to update the display. All installed VXIplug&play drivers will be listed.

Alternatively, you can use the MATLAB function instrhwinfo to find out which drivers are installed.
instrhwinfo ('vxipnp')
ans =
InstalledDrivers: {'tktds5k', 'ag3325b', 'hpe363xa'}
VXIPnPRootPath: 'C:\VXIPNP\WINNT'The cell array returned for InstalledDrivers contains the names of all the installed VXIplug&play drivers. The string returned for VXIPnPRootPath indicates where the drivers are installed.
To use a VXIplug&play driver with a device object, you must have a MATLAB VXIplug&play instrument driver based upon the information in the original VXIplug&play driver. The MATLAB VXIplug&play instrument driver, whether modified or not, acts as a wrapper to the VXIplug&play driver. You can download or create the MATLAB instrument driver.
You might find an appropriate MATLAB driver wrapper for your instrument on the MathWorks Web site, on the Supported Hardware page for the Instrument Control Toolbox software, at
http://www.mathworks.com/products/supportedio.html?prodCode=IC
On this page, click the VXIplug&play link. You then have a choice to go to the MATLAB Central File Exchange, where you can look for the driver you need, or you can submit a request to MathWorks for your particular driver with the Instrument Driver Request Form.
To use the downloaded MATLAB VXIplug&play driver, you must also have the instrument's VXIplug&play driver installed. This driver is probably available from the instrument manufacturer's Web site.
The command-line function makemid creates a MATLAB VXIplug&play instrument driver from a VXIplug&play driver, saving the new driver in a file on disk. The syntax is
makemid('driver','filename')where driver is the original VXIplug&play instrument driver name (identified by instrhwinfo), and filename is the file containing the resulting MATLAB instrument driver. See the makemid reference page for details on this function.
If you need to customize the driver, open the new driver in the MATLAB Instrument Driver Editor, modify it as required, and save it.
Note When you create a MATLAB instrument driver based on a VXIplug&play driver, the original driver must remain installed on your system for you to use the new MATLAB instrument driver. |
The MATLAB Instrument Driver Editor can import a VXIplug&play driver, thereby creating a MATLAB VXIplug&play instrument driver. You can evaluate or set the driver's functions and properties, and you can save the modified MATLAB instrument driver for further use:
In the Import Driver dialog box, select the VXIplug&play driver that you want to import and click Import.
The MATLAB Instrument Driver Editor loads the driver and displays the components of the driver, as shown in the following figures.
MATLAB Instrument Driver Editor Showing tktds5k MATLAB Instrument Driver Summary

tktds5k MATLAB Instrument Driver Display Group Functions

With the MATLAB Instrument Driver Editor, you can:
Create, delete, modify, and rename properties, functions, or groups.
Add code around instrument commands for analysis.
Add create, connect, and disconnect code.
Save the driver as a MATLAB VXIplug&play instrument driver.
For more information, see Using the Instrument Driver Editor.
Note When you create a MATLAB instrument driver based on a VXIplug&play driver, the original driver must remain installed on your system for you to use the new MATLAB instrument driver. |
Once you have the MATLAB VXIplug&play instrument driver, you create the device object with the file name of the driver and a VISA resource name as arguments for icdevice. For example:
obj = icdevice('MATLABVXIpnpDriver.mdd','GPIB0::2::INSTR')
connect(obj)See the icdevice reference page for full details about this function.
![]() | Overview | Using IVI Drivers | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |