From 09:00 PM Friday, August 7 - 10:30 AM CST Saturday, August 8, will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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:


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

public void EnableEvent(
	int customEventType,
	EventMechanism mechanism


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


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

Invalid mechanism specified.


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.


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


Session Class

NationalInstruments.VisaNS Namespace


Not Helpful