Programming Example
Programming in C using the VTL
38
Addressing a Session
As seen in the previous section, the rsrcName parameter in
the viOpen function is used to identify a specific device.
This parameter is made up of the VTL interface name and
the device address. The interface name is determined when
you run the VTL Configuration Utility. This name is usually
the interface type followed by a number. The following table
illustrates the format of the rsrcName for the different
interface types:
The following describes the parameters used above:
Closing a Session
The viClose function must be used to close each session.
You can close the specific device session, which will free all
data structures that had been allocated for the session. If
you close the default resource manager session, all sessions
opened using that resource manager will be closed.
Since system resources are also used when searching for
resources (viFindRsrc) or waiting for events
(viWaitOnEvent), the viClose function needs to be called
to free up find lists and event contexts.
board
This optional parameter is used if you have more than one
interface of the same type. The default value for board is 0.
VXI logical address
This is the logical address of the VXI instrument.
primary address
This is the primary address of the USB device.
secondary address
This optional parameter is the secondary address of the USB
device. If no secondary address is specified, none is assumed.
INSTR
This is an optional parameter that indicates that you are
communicating with a resource that is of type INSTR, meaning
instrument.