Examining Your Hardware Resources
instrhwinfo Function
Note
Using the input arguments ivi
and vxipnp
with instrhwinfo
is not recommended. View installed
MATLAB® instrument drivers by using ividriverlist
or
ividevlist
instead.
Note
Using the input arguments serial
,
serialport
, Bluetooth
,
tcpip
, udp
, visa
,
and gpib
with instrhwinfo
will be
removed in a future release. Use serialportlist
,
bluetoothlist
, or visadevlist
instead.
You can examine the hardware-related resources visible to the
toolbox with the instrhwinfo
function.
The specific information returned by instrhwinfo
depends
on the supplied arguments, and is divided into these categories:
General Toolbox Information
For general information about the Instrument Control Toolbox™, type:
instrhwinfo MATLABVersion: '7.0 (R14)' SupportedInterfaces: {'gpib' 'serial' 'visa' 'tcpip' 'udp'} SupportedDrivers: {'matlab' 'vxipnp' 'ivi'} ToolboxName: 'Instrument Control Toolbox' ToolboxVersion: '2.0 (R14)'
The SupportedInterfaces
and SupportedDrivers
fields
list the interfaces and drivers supported by the toolbox, and not
necessarily those installed on your computer.
Interface Information
To display information about a specific interface, you supply
the interface name as an argument to instrhwinfo
.
The interface name can be gpib
, serial
, tcpip
, udp
,
or visa
.
For the GPIB and VISA interfaces, the information includes installed adaptors. For the serial port interface, the information includes the available ports. For the TCP/IP and UDP interfaces, the information includes the local host address. For example, to display the GPIB interface information:
out = instrhwinfo('gpib') out = InstalledAdaptors: {'ics' 'ni'} JarFileVersion: 'Version 2.0 (R14)'
The InstalledAdaptors
field indicates that ICS Electronics™ (ICS)
and National Instruments™ drivers are installed. Therefore, you
can communicate with instruments using GPIB controllers from these
vendors.
Adaptor Information
To display information about a specific installed adaptor, you
supply the interface name and the adaptor name as arguments to instrhwinfo
.
Interface Name | Adaptor Name |
---|---|
|
|
|
|
The returned information describes the adaptor, the vendor driver, and the object constructors. For example, to display information for the National Instruments GPIB adaptor,
ghwinfo = instrhwinfo('gpib','ni') ghwinfo = AdaptorDllName: [1x82 char] AdaptorDllVersion: 'Version 2.0 (R14)' AdaptorName: 'NI' InstalledBoardIds: 0 ObjectConstructorName: {'gpib('ni', 0, 2);'} VendorDllName: 'gpib-32.dll' VendorDriverDescription: 'NI-488'
The ObjectConstructorName
field provides
the syntax for creating a GPIB object for the National Instruments adaptor.
In this example, the GPIB controller has board index 0
and
the instrument has primary address 2
.
g = gpib('ni',0,2);
To display information for the Tektronix® VISA adaptor,
vhwinfo = instrhwinfo('visa','tek') vhwinfo = AdaptorDllName: [1x83 char] AdaptorDllVersion: 'Version 2.0 (R14 Beta 1)' AdaptorName: 'TEK' AvailableChassis: [] AvailableSerialPorts: {2x1 cell} InstalledBoardIds: 0 ObjectConstructorName: {3x1 cell} SerialPorts: {2x1 cell} VendorDllName: 'visa32.dll' VendorDriverDescription: 'Tektronix VISA Driver' VendorDriverVersion: 2.0500
The available VISA object constructor names are shown below.
vhwinfo.ObjectConstructorName ans = 'visa('tek', 'ASRL1::INSTR');' 'visa('tek', 'ASRL2::INSTR');' 'visa('tek', 'GPIB0::1::INSTR');'
The ObjectConstructorName
field provides
the syntax for creating a VISA object for the GPIB and serial port
interfaces. In this example, the GPIB controller has board index 0
and
the instrument has primary address 1
.
vg = visa('tek','GPIB0::1::INSTR');
Instrument Object Information
To display information about a specific instrument object, you
supply the object as an argument to instrhwinfo
.
For example, to display information for the GPIB object created in
the (Adaptor Information), type:
ghwinfo = instrhwinfo(g) ghwinfo = AdaptorDllName: [1x82 char] AdaptorDllVersion: 'Version 2.0 (R14)' AdaptorName: 'NI' VendorDllName: 'gpib-32.dll' VendorDriverDescription: 'NI-488'
To display information for the VISA-GPIB object created in the (Adaptor Information), type:
vghwinfo = instrhwinfo(vg) vghwinfo = AdaptorDllName: [1x83 char] AdaptorDllVersion: 'Version 2.0 (R14)' AdaptorName: 'TEK' VendorDllName: 'visa32.dll' VendorDriverDescription: 'Tektronix VISA Driver' VendorDriverVersion: 2.0500
Alternatively, you can return hardware information via the Workspace browser by right-clicking an instrument object, and selecting Display Hardware Info from the context menu.
Installed Driver Information
To display information about a supported driver type, you supply
the driver type as an argument to instrhwinfo
.
For example, to display information for the IVI® configuration,
type:
instrhwinfo('ivi') ans = LogicalNames: {'MyIviCLogical' 'MyScope' 'TekScope'} ProgramIDs: {'TekScope.TekScope'} Modules: {'ag3325b'} ConfigurationServerVersion: '1.3.1.0' ConfigurationStoreLocation: 'D:\Apps\IVI\Data\IviConfigurationStore.xml' IVIRootPath: 'D:\Apps\IVI\'
To display information about a specific driver or resource,
you supply the driver name in addition to the type as an argument
to instrhwinfo
. For example,
to display information about the ag3325b
VXIplug&play driver:
instrhwinfo('vxipnp', 'ag3325b') ans = Manufacturer: 'Agilent Technologies' Model: 'Agilent 3325B Synthesizer/Func. Gen.' DriverVersion: '4.1' DriverDllName: 'C:\VXIPNP\WINNT\bin\ag3325b_32.dll'
Test & Measurement Tool
Note
The Test and Measurement Tool app will be removed in a future release. Use the TCP/IP Explorer, UDP Explorer, Serial Explorer, or VISA Explorer app instead.
You can use the Test & Measurement Tool (tmtool
)
to manage the resources of your instrument control session. You can
use this tool to:
Search for installed adaptors.
Examine available hardware.
Examine installed drivers.
Examine instrument objects.
To open the Test & Measurement Tool, type:
tmtool
Hardware
Expand the Hardware
node in the tree to list
the supported interfaces.
Right-click the Hardware
node to scan for
instrument hardware. The interface nodes expand to include entries
for each instrument found by the scan.
Installed Drivers
The Test & Measurement Tool can display your installed drivers.
The three categories of drivers are MATLAB Instrument Drivers
, VXIplug&play
Drivers
, and IVI
, as shown below under
the expanded Instrument Drivers
node.
Right-click the Instrument Drivers
node to
scan for installed drivers. The driver-type nodes expand to include
entries for each driver found by the scan. Note that for MATLAB instrument
drivers and VXIplug&play drivers, the installation
of a driver requires only the presence of a driver file. For IVI,
installation involves an IVI configuration store; see Viewing the IVI Configuration Store.
The Test & Measurement Tool GUI includes embedded help. For further details about the Test & Measurement Tool and its capabilities, see Test & Measurement Tool Overview.
Viewing the IVI Configuration Store
An IVI configuration store greatly enhances instrument interchangeability by providing the means to configure the relationship between drivers and I/O interface references outside of the application. For details of the components of an IVI configuration store, see IVI Configuration Store.
Command-Line Configuration
You can use command-line functions to examine and configure
your IVI configuration store. To see what IVI configuration
store elements are available, use instrhwinfo
to
identify the existing logical names.
instrhwinfo('ivi') ans = LogicalNames: {'MainScope', 'FuncGen'} ProgramIDs: {'TekScope.TekScope','Agilent33250'} Modules: {'ag3325b', 'hpe363xa'} ConfigurationServerVersion: '1.3.1.0' ConfigurationStoreLocation: 'C:\Program Files\IVI\Data\ IviConfigurationStore.xml' IVIRootPath: 'C:\Program Files\IVI\'
Use instrhwinfo
with a logical name as an
argument to see the details of that logical name's configuration.
instrhwinfo('ivi','MainScope') ans = DriverSession: 'TekScope.DriverSession' HardwareAsset: 'TekScope.Hardware' SoftwareModule: 'TekScope.Software' IOResourceDescriptor: 'GPIB0::13::INSTR' SupportedInstrumentModels: 'TekScope 5000, 6000 and 7000 series' ModuleDescription: 'TekScope software module desc' ModuleLocation: ''
You create and configure elements in the IVI configuration
store by using the IVI configuration store object functions add
, commit
, remove
, and update
. For further details, see the
reference pages for these functions.
Using the Test & Measurement Tool
Note
The Test and Measurement Tool app will be removed in a future release. Use the TCP/IP Explorer, UDP Explorer, Serial Explorer, or VISA Explorer app instead.
You can use the Test & Measurement Tool to examine or configure your IVI configuration store. To open the tool, type:
tmtool
Expand the Instrument Drivers
node and click IVI
.
You see a tab for each type of IVI configuration store
element. This figure shows the available driver sessions in the current IVI configuration
store. For the selected driver session, you can use any available
software module or hardware asset. This figure shows the configuration
for the driver session TekScope.DriverSession
,
which uses the software module TekScope.Software
and
the hardware asset TekScope.Hardware
.