|Download Help (Windows Only)|
Enables notification of a MessageBasedSession event.
Assembly: NationalInstruments.VisaNS (in NationalInstruments.VisaNS.dll) Version: 220.127.116.11
|Visual Basic (Declaration)|
Public Sub EnableEvent ( _ eventToEnable As MessageBasedSessionEventType, _ mechanism As EventMechanism _ )
public void EnableEvent( MessageBasedSessionEventType eventToEnable, EventMechanism mechanism )
|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.|
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.
Specify AllEnabledEvents for the eventToEnable parameter to enable all events that were previously enabled on this session. This enumeration value makes it easier to switch between the two callback mechanisms for multiple events.