NIScope.Dispose Method
- Updated2023-09-06
- 1 minute(s) read
NIScopeDispose Method
Closes the specified session and deallocates the reserved resources, if not already disposed.
Namespace: NationalInstruments.ModularInstruments.NIScope
Assembly: NationalInstruments.ModularInstruments.NIScope.Fx45 (in NationalInstruments.ModularInstruments.NIScope.Fx45.dll) Version: 2023
Syntax
Remarks
You can call this method safely more than once, even if the session is already closed.
A call to this method disposes the SafeHandle class used to hold the instrument handle. If the call to this method fails for some reason (e.g., the session was closed by some external means) you will not be notified about the failure. To help you identify failures in the ReleaseHandle method of the SafeHandle class, managed debugging assistant (MDA) is activated.
For details refer to http://msdn.microsoft.com/en-us/library/85eak4a0.aspx.
The call to this method fails when you externally close a session by:
- Initializing a session with a resource name for which the session is already open, within the same process. This causes the instrument handle held by the existing session to become invalid.
- Getting the instrument handle out using GetInstrumentHandle and closing this handle directly.