VISA: Your Passport to Instrument Communication


You have learned about the different ways that instruments can be physically connected to your computer and a little bit about how to speak their language. And, you have even learned how some instruments support different types of physical connections (for example, GPIB and RS-232 Serial), while still speaking the same language, SCPI, in either case. So wouldn't it be nice if the software you wrote to communicate with such an instrument didn't care about the type of physical connection you were using? Then you wouldn't have to write different software for each type of physical connection you might use to connect to your instrument.

This is what VISA, or Virtual Instrument Software Architecture, provides for you. It gives you a set of functions in LabVIEW for sending commands to instruments and reading responses back from them. With VISA, it generally does not matter how the instrument is connected to your computer.

VISA Resource Strings

All VISA needs to know in order to communicate with your instrument is the following:

1.

How your instrument is physically connected.

2.

Where it is located on that physical connection.

You tell VISA this information via a VISA resource string. Table 12.1 shows some syntax for constructing VISA resource strings.

Table 12.1. Physical Connection VISA Resource String Syntax

Physical Connection

VISA Resource String Syntax

VXI

VXI[board]::VXI logical address[::INSTR]

GPIB

GPIB[board]::primary address[::GPIB secondary address][::INSTR]

PXI

PXI[bus]::device[::function][::INSTR]

Serial

ASRL[board][::INSTR]

Serial

COM[port number]

TCP-IP

TCPIP[board]::host address[::LAN device name][::INSTR]

TCP-IP (raw)

TCPIP[board]::host address::port::SOCKET

USB

USB[board]::manufacturer ID::model code::serial number[::USB interface number][::INSTR]


For example, here are some VISA resource names and their meanings.

VISA Resource Name

Description

COM1

Serial port on COM1

ASRL3::INSTR

Serial port on COM3

GPIB0::12::INSTR

GPIB Board number 0, GPIB primary address 12


Configuring Your VISA Resources in MAX

You can configure your VISA resources in the MAX utility, beneath the Devices and Interfaces section, shown in Figure 12.6.

Figure 12.6. Configuring a serial port VISA resource's "Port Settings"


Once your VISA resources are set up in MAX, you can communicate to your instrument in LabVIEW. In LabVIEW, you will use the VISA resource name control (found on the Modern>>I/O palette) to specify your VISA resource, as shown in Figure 12.7.

Figure 12.7. Placing a VISA Resource Name control from the palette onto a VI's front panel


Now that you've seen how to set up your instrument with VISA and how LabVIEW can know about your instrument with a VISA resource name, you're ready for communicating with your instrument. You'll learn how to do this in the next section.




LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net