MATLAB interface instrument driver

조회 수: 8 (최근 30일)
Balachander Ramamurthy
Balachander Ramamurthy 2011년 4월 29일
답변: jiao 2014년 11월 3일
Hi,
I'm trying to conenct an Agilent N9320B spectrum analyser through to Matlab through Agilent VISA USB. I could succesfully create an interafce object and communicate through the interface. But I receive a error message, when I want to use the Matlab interface driver (.mdd file generated from Vxi Plugand paly driver using midedit). see code below for the error message.
>> obj1 = visa('AGILENT', 'USB0::2391::65519::CN03225604::0::INSTR');
>> makemid('agn9320ni') %downloaded and installed driver from NI web
>> d=icdevice('agn9320ni.mdd',obj1); ??? Error using ==> icdevice.icdevice>icdevice.icdevice at 239 The driver must be a MATLAB interface instrument driver.
Strangely, even when I try to create an device object in tmtool, I don’t get an create tab to select the resource.
Any help ?

채택된 답변

Ankit Desai
Ankit Desai 2011년 4월 30일
MDD files can be of multiple types. For example:
1. MATLAB Interface Instrument Driver 2. MATLAB VXIPnP Instrument Driver 3. MATLAB IVI-C Instrument Driver 4. MATLAB IVI-COM Instrument Driver
Depending on the MDD file type the second argument to the icdevice function changes.
For MATLAB Interface Instrument Driver the second argument to the icdevice function should be an interface object (and hence MDD is called "Interface" Instrument Driver).
However, if the MDD is any of the other three types, the second argument to the icdevice function should be the VISA Resource Address (In your case: USB0::2391::65519::CN03225604::0::INSTR)
If you created agn9320ni.mdd from a VXIPnP driver, then you need to pass in the VISA Resource Address as the second argument:
d = icdevice('agn9320ni.mdd','USB0::2391::65519::CN03225604::0::INSTR');
More information on the MDD types can be found at the online help. Here's more information on how to use industry standard drivers.
Hope this helps,
-Ankit
  댓글 수: 2
Balachander Ramamurthy
Balachander Ramamurthy 2011년 5월 2일
Hi Ankit,
Thanks for the reply,
I tried in the same way, I could now able to create the device object but getting error while trying to connect.
See code below, for exactly what I did.
>> instrhwinfo('vxipnp')
ans =
InstalledDrivers: {'SiControl' 'agn9320ni' 'rssifs' 'rssism'}
VXIPnPRootPath: 'C:\Program Files\IVI Foundation\VISA\WINNT'
>> makemid('agn9320ni','test_agn9320ni.mdd','vxiplug&play')
>> d = icdevice('test_agn9320ni.mdd','USB0::0x0957::0xFFEF::CN03225604::0::INSTR')
Instrument Device Object Using Driver : agn9320ni
Instrument Information
Type: VXIPnPInstrument
Manufacturer: Agilent Technologies
Model: Agilent N9320A Spectrum Analyzer
Driver Information
DriverType: MATLAB VXIplug&play
DriverName: agn9320ni
DriverVersion: 1.0
Communication State
Status: closed
>> connect(d)
??? Error using ==> icdevice.connect at 117
The VXIplug&play driver could not connect to the instrument using the specified resource.
If this error is not an instrument error, use MIDEDIT to inspect the driver.
Ankit Desai
Ankit Desai 2011년 5월 4일
You might want to re-check the resource address.
The error indicates that it is an invalid address.
You can check the VISA vendor's tool. For example: NI's Measurement & Automation Explorer or Agilent's Agilent Connection Expert to find out the correct resource address.
You can also get the VISA resource address from the VISA object constructor returned by instrhwinfo('visa',<vendor name>);
Hope this helps.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

jiao
jiao 2014년 11월 3일
hey, did you solve this problem or not?

카테고리

Help CenterFile Exchange에서 Instrument Connection and Communication에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by