The primary classes in the NationalInstruments.Visa namespace are GpibSession, PxiSession, SerialSession, TcpipSession, TcpipSocket, UsbSession, and VxiSession. These Session-derived classes, also referred in this document as the “leaf” classes, derive indirectly from Session. These classes provide the core VISA functionality. Each Session-derived class represents a VISA resource type. Each Session-derived class exposes only the methods, properties, and events that are valid for the resource type that the Session-derived class represents. GpibInterface, PxiBackplane, PxiMemory, UsbRaw, VxiBackplane, and VxiMemory are additional Session-derived leaf classes for advanced applications.
To communicate with a VISA resource in a typical .NET application or library, create an instance of the specific Session-derived class that corresponds to the resource. Set properties on the instance to configure the resource. Call methods on the instance to read from and write to the resource. You must call Dispose to release the resource when you no longer need to access it.
Some types of applications or libraries, such as instrument drivers, must access resources in an interface-independent manner. NI-VISA .NET includes additional classes that you can use to create and access VISA resources in an interface-independent manner. For example, to create an object you can use to communicate with an instrument over a GPIB interface or serial interface, call Open and cast the return value to MessageBasedSession.