|Download Help (Windows Only)|
Serves as the base class for all VISA session objects.
Assembly: NationalInstruments.VisaNS (in NationalInstruments.VisaNS.dll) Version: 126.96.36.199
|Visual Basic (Declaration)|
Public Class Session _ Inherits MarshalByRefObject _ Implements IDisposable, ISynchronizeCallbacks, ISupportSynchronizationContext
public class Session : MarshalByRefObject, IDisposable, ISynchronizeCallbacks, ISupportSynchronizationContext
|Note: In the .NET interface to NI-VISA, a VISA session opens when Dispose method. Ensure that you call Dispose when you are finished with a session.or one of its subclasses is instantiated. A VISA session closes when or one of its subclasses is disposed by calling the|
You cannot read from or write to an instrument or interface if you instantiate MessageBasedSession or RegisterBasedSession directly. However, it is recommended that you instantiate a session indirectly with Open. This method returns the appropriate subclass instance automatically depending on the resource string that you pass as a parameter. The subclass instance is referenced by a generic object reference, but you can cast to the more specific type if you need the behavior.directly. Instead, you must instantiate one of the subclasses directly or indirectly. If you need functionality that is not specific to a hardware interface, you can instantiate
|Note: In some cases, callbacks and event handlers are executed in a different thread than the rest of the program. Therefore, you must take special care when accessing objects that have thread affinity, such as UI controls, from these callbacks and event handlers. For more information, refer to Events, Callbacks, and Thread Safety in Measurement Studio .NET Class Libraries.|
All members of this type are safe for multithreaded operations.