How do I create and use a MATLAB Instrument Driver (.mdd) file for use with my Programmable AC Load Bank NHR 4600?

9 views (last 30 days)
I am using the Instrument Control Toolbox in MATLAB to communicate with and control NHR 4600. I have installed the appropriate there own IVI drivers for this instruments. It own application working fine, but I need to work with this device in SIMULINK environment. And this AC load bank connecting to PC trough COM! by RS 232. I am trying to create a MATLAB Instrument Driver (.mdd) file in order to control the instrument through an interface object.
When using the MAKEMID command to do this, I receive the following error:
>> makemid('NHRACLoad')
Error using makemid (line 152)
The specified driver could not be loaded.
152: error(message('instrument:makemid:conversionErrorLoad'));

Accepted Answer

Sai Kulkarni
Sai Kulkarni on 25 Apr 2016
I understand that you are trying to create a MATLAB Instrument Driver for the NHR 4600 device using the 'makemid' command and receiving the
Since IVI-COM is only supported with 32-bit versions of MATLAB, I am assuming that you are using a 32-bit installation of MATLAB R2015b or earlier. All documentation links in this answer refer to MATLAB R2015a, but you can refer to the appropriate page for the MATLAB release that you are working with.
Try the following troubleshooting steps for this issue:
Basic Troubleshooting
  • Are you able to view the device information using the command "instrhwinfo('ivi')"? If not, follow the directions listed on this documentation page: Getting Started with IVI Drivers
  • Make sure that 'NHRACLoad' is exactly same as either the driver name or the device's logical name as it appears in the output of "instrhwinfo('ivi')".
Failure to Locate Driver File
In certain MATLAB versions, his error can occur if the IVI-C driver is installed into a folder name that does not match the driver prefix specified in the IVI Configuration Store.
To work around this issue you can change the folder name in which the driver FP-file is present to match the prefix for the driver. The following steps use Agilent 34980A as an example, but you can follow similar steps for your device as well.
  • Determine the location of the IVI root directory. This can be done by examining the IVIRootPath filed returned by the command
>> iviinfo = instrhwinfo('ivi');
>> iviinfo.IVIRootPath
ans =
D:\Applications\IVI\
  • Go to the IVI root directory and then into the "Drivers" sub folder.
>> cd(iviinfo.IVIRootPath)
>> cd Drivers\
  • Look for your drivers directory in this folder. For example the "AqD1" driver is located in a folder called "IviAqD1"
>> dir
. AgSAn AgilentInfiniium ividcpwr ivirfsiggen
.. Agilent34401 AgilentSa ividmm iviscope
AGN6030A Agilent34980A IviAqD1 ivifgen ivispecan
AgRFPowerMeter Agilent546XX TekScope ivipwrmeter iviswtch
  • Look in the directory for you driver and see the name of the FP and SUB files.
>> cd Agilent34980A
>> dir *.fp
ag34980a.fp
  • The name of the directory should match the name of the FP file. In this case, the directory name should be changed to ag34980a.fp. This also must be the name of the DLL-file in the "bin" folder of the IVI root directory. The DLL-file may have an optional "_32" appended to the end of the file.
>> cd ..
>> movefile Agilent34980A ag34980a
  • You can now create the MDD-file with the MAKEMID command and use it with ICDEVICE
>> makemid('ag34980a','ag34980a.mdd')
>> instr = icdevice('ag34980a.mdd','GPIB0::1::INSTR');
  • Other applications may expect the old directory name. Once the MDD-file has been generated, you can quit MATLAB and rename the directory back to its original name.
Additional Resources
  4 Comments
Vinod
Vinod on 8 Nov 2016
Pooja: Can you make sure you have one of these VISA support packages installed
Once the support package is installed, please type in the results of executing the following at your MATLAB prompt
>> computer('arch')
Also,
>> instrhwinfo ivi

Sign in to comment.

More Answers (0)

Categories

Find more on Instrument Connection and Communication in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!