Open the VISA
To communicate with the device of GPIB, RS232C, USB, or LAN via VISA, it requires to open
the VISA first. When opening the VISA, specify the I/O resource.
Example : To open VISA by using USB
Set rm = CreateObject("VISA.GlobalRM")
Set msg = rm.Open("USB::0x0B3E::0x100E::00000001::INSTR", NO_LOCK, 0, "")
"USB::0x0B3E::0x100E::00000001::INSTR" is the I/O resource.
The I/O resource is specified by the following constructions. The part indicated with [ ] can
be abbreviated. Enter the appropriate value in the part specified in oblique characters.
GPIB
GPIB[
board
]::
PrimaryAddress
[::
SecondaryAddress
][::INSTR]
Example : The primary address 3 of the measuring instrument connected to GPIB0.
GPIB0::3::INSTR
Serial
(RS232C)
ASRL[
board
][::INSTR]
Example : The measuring instrument connected to the serial port COM1.
ASRL1::INSTR
USB
USB[
board
]::
VendorID
::
ProductID
::
SerialNumber
[::
InterfaceNumber
][::INSTR]
Example : The USNTMC measuring instrument having with the vendor ID (VID)2878,
Product ID(PID)4111 and serial number "00000001".
USB0::0x0B3E::0x100E::00000001::INSTR
LAN
TCPIP[
board
]::
LAN divice name
[::inst
0
][::INSTR]
Example :The measuring instrument whose IP address (LAN device name) is
169.254.7.8.
TCPIP::169.254.7.8::INSTR
You can also set the LAN device name using the host name.
For VISA, the alias can be used for the I/O resource.
When using the alias for the I/O resource, even the alias name to be hard coating directly in
the application, it can be easily converted to the appropriate I/O resource name.
Example : When using the alias (MYDEV1) for the I/O resource.
Set msg = rm.Open("MYDEV1", NO_LOCK, 0, "")
When the alias is used, the actual I/O resource is specified by such an external configuration
table. When using the USB (example for KI-VISA)
In case of using VISA other than KI-VISA, please refer to the applied VISA manual.
Controlling the devices
Next, using such a "Read", "Write" to control the devices.
Example:
msg.WriteString ("VOLT 13.5") 'Set 13.5 V
msg.WriteString ("CURR 150.0") 'Set 10 A
msg.WriteString ("OUTP 1") 'Output on
Closing the VISA.
Close the VISA at the end.
PAT-T series Communication Interface Manual
KIKUSUI ELECTRONICS CORP.
54/158