NI-SCOPE .NET Class Library Help

Table of Contents

ScopeDriverOperation.Dispose Method

  • Updated2023-09-06
  • 1 minute(s) read
ScopeDriverOperation.Dispose Method

ScopeDriverOperationDispose 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

public void Dispose()
Public Sub Dispose

Implements

IDisposableDispose

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 due to some reason, such as the session being 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.

See Also

Log in to get a better experience