Professional Documents
Culture Documents
Default value
Constraint value
Data type
Using INSTRHWINFO
You can use INSTRHWINFO to display information relating to the toolbox and
supported instrument interfaces.
instrinfo = instrhwinfo
instrinfo =
With the Instrument Control Toolbox, you can communicate with serial ports on
the Windows®, Solaris™, and Linux® platforms. To obtain serial-specific
information, the string 'serial' is passed to the INSTRHWINFO function.
serialinfo = instrhwinfo('serial')
serialinfo =
AvailableSerialPorts: {'COM1'}
JarFileVersion: 'Version 2.3'
ObjectConstructorName: {'serial('COM1');'}
SerialPorts: {'COM1'}
All serial ports on your machine are listed in the SerialPorts field.
serialinfo.SerialPorts
ans =
'COM1'
The serial ports currently not in use are listed in the AvailableSerialPorts field.
serialinfo.AvailableSerialPorts
ans =
'COM1'
The commands for creating serial port objects are listed in the
ObjectConstructorName field.
serialinfo.ObjectConstructorName
ans =
'serial('COM1');'
GPIB Information
gpibinfo = instrhwinfo('gpib')
gpibinfo =
Note, the adaptors listed are dependent on which vendor drivers you have installed
on your computer. Only those adaptors that can be loaded (because the necessary
drivers are installed on your computer) are listed.
gpibinfo.InstalledAdaptors
ans =
vendorinfo = instrhwinfo('gpib','ni')
vendorinfo =
AdaptorDllName: 'C:\Program
Files\MATLAB\toolbox\instrument\ins
trumentadaptors\win32\mwnigpib.dll'
AdaptorDllVersion: 'Version 2.3'
AdaptorName: 'ni'
InstalledBoardIds: [0 1 2]
ObjectConstructorName: {3x1 cell}
VendorDllName: 'gpib-32.dll'
VendorDriverDescription: 'NI-488'
The commands necessary for creating a GPIB object are listed in the
ObjectConstructorName field.
vendorinfo.ObjectConstructorName
ans =
'gpib('ni', 0, 2);'
'gpib('ni', 0, 24);'
'gpib('ni', 2, 30);'
VISA Information
The Instrument Control Toolbox provides access to the serial port, GPIB hardware,
VXI hardware, and GPIB-VXI hardware using the VISA standard. To obtain
VISA-specific information, the string 'visa' is passed to the INSTRHWINFO
function.
visainfo = instrhwinfo('visa')
visainfo =
InstalledAdaptors: {'ni'}
JarFileVersion: 'Version 2.3'
VISA Adaptor
Note, the adaptors listed are dependent on which vendor drivers you have installed
on your computer. Only those adaptors that can be loaded (because the necessary
drivers are installed on your computer) are listed.
visainfo.InstalledAdaptors
ans =
'ni'
vendorinfo = instrhwinfo('visa','ni')
vendorinfo =
AdaptorDllName: 'C:\Program
Files\MATLAB\toolbox\instrument\ins
trumentadaptors\win32\mwnivisa.dll'
AdaptorDllVersion: 'Version 2.3'
AdaptorName: 'NI'
AvailableChassis: []
AvailableSerialPorts: {2x1 cell}
InstalledBoardIds: [2x1 double]
ObjectConstructorName: {5x1 cell}
SerialPorts: {2x1 cell}
VendorDllName: 'visa32.dll'
VendorDriverDescription: 'National Instruments VISA
Driver'
VendorDriverVersion: 3.3000
'visa('ni', 'ASRL1::INSTR');'
'visa('ni', 'ASRL10::INSTR');'
'visa('ni', 'GPIB0::2::INSTR');'
'visa('ni', 'GPIB0::24::INSTR');'
'visa('ni', 'GPIB2::30::INSTR');'
tcpipinfo = instrhwinfo('tcpip')
tcpipinfo =
LocalHost: {'testmachine/144.212.105.22'}
JarFileVersion: 'Version 2.3'
Passing the string 'udp' to the INSTRHWINFO function returns the same
information.
mlinfo = instrhwinfo('matlab')
mlinfo =
mlinfo.InstalledDrivers
ans =
Columns 1 through 5
'agilent_33120a' 'agilent_34401a'
'agilent_e3648a' 'tektronix_t
ds2024' 'tektronix_tds210'
Columns 6 through 13
'MyPSDriver' 'MyScope' 'MyScope2'
'ScopeMath' 'TekScopeIvi'
'age364xa' 'rssfl' 'rssmr'
Columns 14 through 16
Manufacturer: 'Agilent'
Model: '33120A'
Type: 'Function Generator'
DriverType: 'MATLAB interface object'
DriverName: 'C:\Program
Files\MATLAB\toolbox\instrument\instrument\dr
ivers\agilent_33120a.mdd'
DriverVersion: '1.0'
DriverDllName: ''
iinfo = instrhwinfo('ivi')
iinfo =
To obtain information on a specific IVI logical name, pass the string 'ivi' and the
IVI logical name to the INSTRHWINFO function.
DriverSession: 'TekScope.DriverSession'
HardwareAsset: 'TekScope.Hardware'
SoftwareModule: 'TekScope.Software'
IOResourceDescriptor: 'GPIB0::4::INSTR'
SupportedInstrumentModels: 'TekScope 5000, 6000 and
7000 series oscillos
copes.'
ModuleDescription: 'TekScope software
module description'
ModuleLocation: ''
Using PROPINFO
g = gpib('ni', 0, 4);
gInfo = propinfo(g)
gInfo =
Property Information
modeInfo = gInfo.RecordMode
modeInfo =
Type: 'string'
Constraint: 'enum'
ConstraintValue: {3x1 cell}
DefaultValue: 'overwrite'
ReadOnly: 'whileRecording'
InterfaceSpecific: 0
modeInfo.ConstraintValue
ans =
'overwrite'
'append'
'index'
Alternatively, you can pass a property name to the PROPINFO function. In this
example, information on the CompareBits property is returned.
Type: 'double'
Constraint: 'bounded'
ConstraintValue: [7 8]
DefaultValue: 8
ReadOnly: 'never'
InterfaceSpecific: 1
delete(g);
Using INSTRHELP
You can use INSTRHELP to display property and function help. The "See Also"
section that follows the display contains related properties and functions. The
related properties are displayed using mixed case. The related functions are
displayed using upper case.
instrhelp RecordStatus
RECORDSTATUS [ {off} | on ] (read only)
instrhelp get
GET Get instrument or device group object properties.
Example:
g = gpib('ni', 0, 2);
get(g, {'PrimaryAddress','EOSCharCode'})
out = get(g, 'EOIMode')
get(g)