System information
G2T Programmers Guide Rev-A 17-Nov-2014
30
4.1. Remote Resources
The most versatile way to communicate is through Virtual
Instrument System Architecture (VISA) library. Typically, this API
contains a series of functions designed for interface-independent,
device-independent and platform-independent access to
instruments connected to a "host". To use, the calling program
calls the function viOpen() with a "resource name" as one of the
arguments. If successful, the function returns a handle to a VISA
"session" which can be used to call the other VISA functions.
A download of VISA usually contains an application for accessing
the API from either a command line or a GUI. This can also be
used to access the instrument. Don't forget to append the
"linefeed" character ('\n' or 0x0a) as the last character.
The VISA API requires the resource descriptor to figure out how to
communicate with the instrument. Some tasks of the VISA API are
explained below:
• It figures out which calls to make to which interface
(socket, GPIB, serial or future interfaces)
• It knows the capabilities of each interface. For example,
the viReadSTB function "serial polls" a GPIB instrument, but
send "*STB?\n" and read the response on serial or TCP/IP. It
knows that serial has a baud rate and that GPIB has,
among other lines, attention and trigger.
• Buffers characters, manages time-out.
• Multiple sessions can be opened to each instrument. It
automatically handles contention issues (including locks).