Open Method (String)

NI-VisaNS .NET Class Library Help for Visual Studio 2010

Edition Date: August 2012

Part Number: 370627F-01

»View Product Info
Download Help (Windows Only)

ResourceManager Class See Also


Initializes a new instance of a subclass of Session from the specified resource name.

Namespace: NationalInstruments.VisaNS

Assembly: NationalInstruments.VisaNS (in NationalInstruments.VisaNS.dll) Version: 13.0.40.167

Syntax

Visual Basic (Declaration)
Public Function Open ( _
	resourceName As String _
) As Session

C#
public Session Open(
	string resourceName
)

Parameters

resourceName
Type: System.String
String that describes a unique VISA resource.

Return Value

A new instance of a subclass of Session.

Exceptions

ExceptionCondition
VisaException There are problems opening a VISA session to resourceName.
ArgumentException

Insufficient location information, or the device or resource is not present in the system.

-or-

The interface type is valid, but the specified interface number is not configured.

-or-

The type that this method should instantiate cannot be determined.

DllNotFoundException The NI-VISA driver library cannot be found.
EntryPointNotFoundException A required operation in the NI-VISA driver library cannot be found.

Remarks

This method instantiates the correct subclass based on the resourceName. For example, if you set resourceName to "GPIB0::2::INSTR", the Open method instantiates a GpibSession object. Likewise, if you set resourceName to "TCPIP::MyComputerName::7::SOCKET", the Open method instantiates a TcpipSocket object.

.NET Framework Security

See Also

Reference

ResourceManager Class

NationalInstruments.VisaNS Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful