NI-DCPower .NET fx40 API Reference

Table of Contents

NIDCPower.Close Method

  • Updated2024-01-04
  • 2 minute(s) read
NIDCPower.Close Method

NIDCPowerClose Method

Closes the session to the instrument and deallocates the resources that NI-DCPower reserved.

Namespace:  NationalInstruments.ModularInstruments.NIDCPower
Assembly:  NationalInstruments.ModularInstruments.NIDCPower.Fx40 (in NationalInstruments.ModularInstruments.NIDCPower.Fx40.dll) Version: 2023

Syntax

public void Close()
Public Sub Close

Remarks

If power output is enabled when you call this method, the output channels remain in their existing state and continue providing power. Use Reset or Enabled to disable power output on a per-channel basis.

The Close method can be called safely more than once, even if the session is already closed.

Calling close, disposes the SafeHandle used to hold the instrument handle. The ReleaseHandle method of the SafeHandle is overridden in our concrete implementation of SafeHandle, which calls into the Close of the Underlying driver. If a call to this Close fails for any reason, the most common being the session being closed by some external means, the user won't be notified of the failure. In order to help users identify failures in ReleaseHandle method, managed debugging assistant (MDA) is activated to notify developers when ReleaseHandle fails. http://msdn.microsoft.com/en-us/library/85eak4a0.aspx

Common ways of externally closing a session:

1. Initializing a session with a resource name for which a session is already open, within the same process. Initializing a new session with the same resource name causes the instrument handle held by the existing session to become invalid.

2. User gets the instrument handle out using the GetInstrumentHandle method and closes this handle directly.

Note Note
NI-DCPower uses the terms "source" and "output". However, while sinking with electronic loads and SMUs these correspond to "sinking" and "input", respectively.

See Also

Log in to get a better experience