| Instrument Control Toolbox | ![]() |
Syntax
Arguments
Description
obj = visa(' creates the VISA object vendor','rsrcname')
obj with a resource name given by rsrcname for the vendor specified by vendor. If an invalid vendor or resource name is specified, an error is returned and the VISA object is not created. The supported values for vendor are given below.
| Vendor |
Description |
agilent |
Agilent Technologies VISA |
ni |
National Instruments VISA |
tek |
Tektronix VISA |
The format for rsrcname is given below for the supported VISA interfaces. The values indicated by brackets are optional.
The rsrcname parameters are described below.
obj = visa(' creates the VISA object with the specified property names and property values. If an invalid property name or property value is specified, an error is returned and the VISA object is not created.vendor','rsrcname','PropertyName',PropertyValue,...)
Remarks
At any time, you can use the instrhelp function to view a complete listing of properties and functions associated with VISA objects.
You can specify the property names and property values using any format supported by the set function. For example, you can use property name/property value cell array pairs. Additionally, you can specify property names without regard to case, and you can make use of property name completion. For example, the following commands are all valid.
v = visa('ni','GPIB0::1::INSTR','SecondaryAddress', 96);v = visa('ni','GPIB0::1::INSTR','secondaryaddress', 96);v = visa('ni','GPIB0::1::INSTR','SECOND', 96);
Before you can communicate with the instrument, it must be connected to obj with the fopen function. A connected instrument object has a Status property value of open. An error is returned if you attempt a read or write operation while obj is not connected to the instrument. You cannot connect multiple VISA objects to the same instrument.
Creating a VISA-GPIB Object
When you create a VISA-GPIB object, these properties are automatically configured:
Type is given by visa-gpib.
Name is given by concatenating VISA-GPIB with the board index, the primary address, and the secondary address.
BoardIndex, PrimaryAddress, SecondaryAddress, and RsrcName values are given by the values specified during object creation.
Creating a VISA-VXI Object
When you create a VISA-VXI object, these properties are automatically configured:
Type is given by visa-vxi.
Name is given by concatenating VISA-VXI with the chassis index and the logical address specified in the visa function.
ChassisIndex, LogicalAddress, and RsrcName values are given by the values specified during object creation.
Creating a VISA-GPIB-VXI Object
When you create a VISA-GPIB-VXI object, these properties are automatically configured:
Type is given by visa-gpib-vxi.
Name is given by concatenating VISA-GPIB-VXI with the chassis index and the logical address specified in the visa function.
ChassisIndex, LogicalAddress, and RsrcName values are given by the values specified during object creation.
BoardIndex, PrimaryAddress, and SecondaryAddress values are given by the visa driver after the object is connected to the instrument with fopen.
Creating a VISA-Serial Object
When you create a VISA-serial object, these properties are automatically configured:
Type is given by visa-serial.
Name is given by concatenating VISA-Serial with the port specified in the visa function.
Port and RsrcName values are given by the values specified during object creation.
Example
Create a VISA-serial object connected to serial port COM1 using National Instruments VISA interface.
Create a VISA-GPIB object connected to board 0 with primary address 1 and secondary address 30 using Agilent Technologies VISA interface.
Create a VISA-VXI object connected to a VXI instrument located at logical address 8 in the first VXI chassis.
Create a VISA-GPIB-VXI object connected to a GPIB-VXI instrument located at logical address 72 in the second VXI chassis.
Functions
fclose, fopen, instrhelp, instrhwinfo
Properties
BoardIndex, ChassisIndex, LogicalAddress, Name, Port, PrimaryAddress, RsrcName, SecondaryAddress, Status, Type
| udp | Property Reference | ![]() |