viDisableEvent
Syntax
viDisableEvent(ViSession vi, ViEventType eventType, ViUInt16 mechanism);
Description
This function disables servicing of an event identified by the eventType parameter for the mechanisms specified in the mechanism parameter. Specifying VI_ALL_ENABLED_EVENTS for the eventType parameter allows a session to stop receiving all events. The session can stop receiving queued events by specifying VI_QUEUE. Applications can stop receiving callback events by specifying either VI_HNDLR or VI_SUSPEND_HNDLR. Specifying VI_ALL_MECH disables both the queuing and callback mechanisms. viDisableEvent prevents new event occurrences from being added to the queue(s). However, event occurrences already existing in the queue(s) are not discarded.
Parameters
Please note, this function is available for both Windows and Linux users, however, VXI and PXI functionality are Windows only.
Name |
Dir |
Type |
Description |
---|---|---|---|
vi |
IN |
ViSession |
Unique logical identifier to a session. |
eventType |
IN |
ViEventType |
Logical event identifier. (See the following tables.) |
mechanism |
IN |
ViUInt16 |
Specifies event handling mechanisms to be disabled. The queuing mechanism is disabled by specifying VI_QUEUE. The callback mechanism is disabled by specifying VI_HNDLR or VI_SUSPEND_HNDLR. It is possible to disable both mechanisms simultaneously by specifying VI_ALL_MECH. |
Special Values for eventType Parameter |
|||
Value |
|
|
Action Description |
VI_ALL_ENABLED_EVENTS |
|
|
Disable all events that were previously enabled. |
The following events can be disabled: |
|||
Event Name |
|
|
Description |
VI_EVENT_IO_COMPLETION |
|
|
Notification that an asynchronous operation has completed. |
VI_EVENT_TRIG |
|
|
Notification that a hardware trigger was received from a device. |
VI_EVENT_SERVICE_REQ |
|
|
Notification that a device is requesting service. |
VI_EVENT_CLEAR |
|
|
Notification that the local controller has been sent a device clear message |
VI_EVENT_EXCEPTION |
|
|
Notification that an error condition has occurred during an operation invocation. (Note: the VI_QUEUE and VI_SUSPEND_HNDLR mechanisms cannot be used with this event.) |
VI_EVENT_GPIB_CIC |
|
|
Notification that the GPIB controller has gained or lost CIC (controller in charge) status. |
VI_EVENT_GPIB_TALK |
|
|
Notification that the GPIB controller has been addressed to talk. |
VI_EVENT_GPIB_LISTEN |
|
|
Notification that the GPIB controller has been addressed to listen. |
VI_EVENT_PXI_INTR |
|
|
Notification that a vendor-specific PXI interrupt was received from
the device. |
VI_EVENT_VXI_VME_SYSFAIL |
|
|
Notification that the VXI/VME SYSFAIL* line has been
asserted. |
VI_EVENT_VXI_VME_SYSRESET |
|
|
Notification that the VXI/VME SYSRESET* line has been
asserted |
VI_EVENT_VXI_SIGP |
|
|
Notification that a VXI signal or VXI interrupt has
been received from a device. |
VI_EVENT_VXI_VME_INTR |
|
|
Notification that a VXIbus interrupt was received from
the device. |
Not supported by Keysight VISA: |
|||
VI_EVENT_TCPIP_CONNECT |
|
|
Notification that a TCP/IP connection has been made. |
VI_EVENT_USB_INTR
|
|
|
Notification that a vendor-specific USB interrupt was received from the device. |
![]() |
Refer to the viEventHandler topic and the VISA Attributes topics for information on the event types that are available for various VISA resource classes (e.g. INSTR, INTFC …). | ||
Special Values for mechanism Parameter |
|||
Value |
|
|
Action Description |
VI_ALL_MECH |
|
|
Disable this session from receiving the specified event(s) via any mechanism. |
VI_HNDLR or |
|
|
Disable this session from receiving the specified event(s) via a callback handler or a callback queue. |
VI_QUEUE |
|
|
Disable this session from receiving the specified event(s) via the waiting queue. |
Return Values
Type ViStatus |
This is the function return status. It returns either a completion code or an error code as follows. |
Completion Code |
Description |
---|---|
VI_SUCCESS |
Event disabled successfully. |
VI_SUCCESS_EVENT_DIS |
Specified event is already disabled for at least one of the specified mechanisms. |
Error Code |
Description |
VI_ERROR_INV_EVENT |
Specified event type is not supported by the resource. |
VI_ERROR_INV_MECH |
Invalid mechanism specified. |
VI_ERROR_INV_SESSION |
The given session or object reference is invalid (both are the same value). |
See Also
See the handler prototype viEventHandler for its parameter description, and viEnableEvent. Also, see viInstallHandler and viUninstallHandler descriptions for information about installing and uninstalling event handlers. See event descriptions for context structure definitions.