vxiplug&play drivers -凯发k8网页登录

main content

vxiplug&play drivers

installing vxiplug&play drivers

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 function 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.

creating a matlab vxiplug&play instrument driver

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.

downloading a driver from the mathworks website

you might find an appropriate matlab driver wrapper for your instrument from the page on the mathworks website. you can search for the driver you need or you can submit a request to mathworks for your particular driver.

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 website.

creating a driver with makemid

the command-line function 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 ), and filename is the file containing the resulting matlab instrument driver. see the 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.

importing with the matlab instrument driver editor (midedit)

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:

  1. open the matlab instrument driver editor with midedit.

  2. select file > import.

  3. 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 .

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.

constructing device objects using a matlab vxiplug&play 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 . for example:

obj = icdevice('matlabvxipnpdriver.mdd','gpib0::2::instr')
connect(obj)

see the reference page for full details about this function.

creating shared libraries or standalone applications when using ivi-c or vxi

when using ivi-c or vxiplug&play drivers, executing your code will generate additional file(s) in the folder specified by executing the following code at the matlab prompt:

sprintf('%s',[tempdir 'ictdeploymentfiles'])

on all supported platforms, a file with the name matlabprototypefor.m is generated, where the name of the ivi-c or vxiplug&play driver. with 64-bit matlab on windows®, a second file by the name _thunk_pcwin64.dll is generated. when creating your deployed application or shared library, manually include these generated files. for more information on including additional files refer to the matlab compiler documentation.

网站地图