MATLAB: Do I receive an error when I invoke the SELFTEST function in a MATLAB Instrument Driver using the Instrument Control Toolbox 2.8 (R2009a)

icdevice.selftestInstrument Control Toolboxselftest

I am using the MAKEMID command to generate a MATLAB Instrument Driver (MDD) as follows:
makemid('AgilentRfSigGen.AgilentRfSigGen','AgilentRfSigGen','ivi-com','IIviRFSigGen')
Once I generate the MDD file, I create a device object in the MATLAB workspace and I inspect this object using the METHODS function:
>> deviceObj = icdevice('AgilentRfSigGen.mdd','visaAlias')
Instrument Device Object Using Driver : AgilentRfSigGen.mdd
Instrument Information
Type: IIviRFSigGen
Manufacturer: Manufacturer
Model: Model
Driver Information
DriverType: MATLAB IVI
DriverName: AgilentRfSigGen.mdd
DriverVersion: 1.0
Communication State
Status: closed
>> connect(deviceObj)
>> methods(deviceObj)
Methods for class icdevice:
.
.
.
ctranspose horzcat invoke propinfo
delete icdevice isa selftest
devicereset igetfield isequal set
.
.
.
One of the methods listed here is the SELFTEST method. However, when I try to invoke this method:
selftest(deviceObj)
I receive the following error message:
??? Error using ==> icdevice.selftest at 25
The call to the driver selftest method failed. Use MIDEDIT to update the driver if appropriate.

Best Answer

The SELFTEST function associated with the device object is introduced as a place-holder function in auto-generated MATLAB Instrument Drivers. This function is for MathWorks testing purposes only and is not meant to replicate the behavior of, or replace, the SELFTEST function of the instrument.
The instrument specific SELFTEST function can usually be found in the UTILITY group of the device object. To invoke the correct SELFTEST function, execute the following code:
deviceObj = icdevice('AgilentRfSigGen.mdd','visaAlias')
connect(deviceObj)
utilObj = get(deviceObj,'Utility') %Assuming that SELFTEST is part of UTILITY
SelfTest(utilObj)