DiscardEvent 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


Discards event occurrences for the specified event type and mechanism in a session.

Namespace: NationalInstruments.VisaNS

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

Syntax

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

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

Parameters

customEventType
Type: System.Int32
Logical event identifier.
mechanism
Type: NationalInstruments.VisaNS.EventMechanism
Specifies the mechanism for which the event is to be discarded.

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

The DiscardEvent method discards all pending occurrences of the specified event on the queuing mechanism from the specified session. Specify 0x3FFF7FFF for the customEventType parameter to discard pending occurrences of events on all the events previously enabled on the session.

This method is useful to remove event occurrences that an application no longer needs. The discarded event occurrences are not available to the session at a later time.

Note: This method does not apply to events that have already been delivered to the application.

See Also

Reference

Session Class

NationalInstruments.VisaNS Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful