DisableEvent 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


Disables notification of the specified event type on the specified event-handling mechanism.

Namespace: NationalInstruments.VisaNS

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

Syntax

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

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

Parameters

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

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.
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 unavailable in the API.
The DisableEvent method disables servicing of an event for the mechanism specified in the mechanism parameter. This method prevents new event occurrences. However, event occurrences already existing in the queue are not flushed. Use DiscardEvent to discard events remaining in the queue.

Specify 0x3FFF7FFF for the customEventType parameter to disable all of the events that had previously been enabled. Specify Queue to stop the session from receiving queued events. Specify Handler to stop applications from receiving callback events.

Note: Calling DisableEvent prevents future events from being raised on the session. When the method returns to the application, a callback might be active, such as on another thread. You can call DisableEvent from within the callback, but it is not recommended.

See Also

Reference

Session Class

NationalInstruments.VisaNS Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful