| Instrument Control Toolbox | ![]() |
Return information about available hardware
Syntax
out = instrhwinfo out = instrhwinfo('interface') out = instrhwinfo('interface','adaptor') out = instrhwinfo('interface','adaptor','type') out = instrhwinfo(obj) out = instrhwinfo(obj,'FieldName')
Arguments
Description
out = instrhwinfo
returns hardware information to the structure out. This information includes the toolbox version, MATLAB version and supported interfaces.
out = instrhwinfo(' returns information related to the interface specified by interface')
interface. interface can be serial, gpib, tcpip, udp, or visa. For the GPIB and VISA interfaces, the information includes the installed adaptors. For the serial port interface, the information includes the available ports and the object constructor name. For the TCP/IP and UDP interfaces, the information includes the local host address.
out = instrhwinfo(' returns information related to the adaptor specified by interface','adaptor')
adaptor, and for the interface specified by interface. interface can be gpib or visa. The returned information includes the adaptor version and available hardware. The GPIB adaptors are agilent, cec, iotech, keithley, mcc, and ni. The VISA adaptors are agilent, ni, and tek.
out = instrhwinfo('interface','adaptor','type')
returns a structure, out, which contains information on the specified type, type. interface can only be visa. adaptor can be agilent, ni, or tek. type can be gpib, vxi, gpib-vxi, serial, or rsib.
out = instrhwinfo(obj)
returns information on the adaptor and vendor-supplied DLL associated with the VISA or GPIB object obj. If obj is a serial port, TCP/IP, or UDP object, then JAR file information is returned. If obj is an array of instrument objects, then out is a 1-by-n cell array of structures where n is the length of obj.
out = instrhwinfo(obj,' returns hardware information for the field name specified by FieldName')
FieldName. FieldName can be a single string or a cell array of strings. out is a m-by-n cell array where m is the length of obj and n is the length of FieldName. You can return the supported values for FieldName using the instrhwinfo(obj) syntax.
Remarks
As shown below, you can also display hardware information via the Workspace browser by right-clicking an instrument object, and selecting Explore -> Display Hardware Info from the context menu.

Example
The following commands illustrate some of the ways you can get hardware-related information without creating an instrument object.
out1 = instrhwinfo; out2 = instrhwinfo('serial'); out3 = instrhwinfo('gpib','ni'); out4 = instrhwinfo('visa','agilent');
The following commands illustrate some of the ways you can get hardware-related information for an existing instrument object.
vs = visa('agilent','ASRL1::INSTR'); out5 = instrhwinfo(vs) out5 = AdaptorDllName: [1x67 char] AdaptorDllVersion: 'Version 1.2 (R13)' AdaptorName: 'AGILENT' VendorDriverDescription: 'Agilent Technologies VISA Driver' VendorDriverVersion: '1.1000' vsdll = instrhwinfo(vs,'AdaptorDllName') vsdll = D:\V6\toolbox\instrument\instrumentadaptors\win32\ mwagilentvisa.dll
| instrhelp | instrreset | ![]() |