EnableEvent Method

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)

Session Class See Also


Enables notification of an event.

Namespace: NationalInstruments.VisaNS

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

Syntax

Visual Basic (Declaration)
Public Sub EnableEvent ( _
	customEventType As Integer, _
	mechanism As EventMechanism _
)

C#
public void EnableEvent(
	int customEventType,
	EventMechanism mechanism
)

Parameters

customEventType
Type: System.Int32
Custom logical event identifier.
mechanism
Type: NationalInstruments.VisaNS.EventMechanism
Event-handling mechanism to enable.

Exceptions

ExceptionCondition
VisaException The NI-VISA driver returned an error as a result of calling this method.
ArgumentException

Invalid mechanism specified.

-or-

Specified event type is not supported by the resource.

DllNotFoundException The NI-VISA driver library cannot be found.
EntryPointNotFoundException A required operation in the NI-VISA driver library cannot be found.
InvalidOperationException A handler is not currently installed for the specified event.
ObjectDisposedException This member is called after the Dispose method is called directly from code or indirectly through a finalizer.

Remarks

Note: This method is provided for extensibility only and should not be used unless the event you want to enable is not available in the API.
The EnableEvent method enables notification of an event for the mechanism specified in the mechanism parameter.

Specify Queue to enable the specified session to queue events. If the specified mechanism is Queue, you must call WaitOnEvent to wait for enabled events that might have occurred. When you specify Handler, applications can enable the session to invoke a callback method to execute the handler. In order to enable events with the Handler mechanism, applications must install at least one handler.

See Also

Reference

Session Class

NationalInstruments.VisaNS Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful