User`s guide

68 Agilent VISA User’s Guide
3 Programming with VISA
Use the viUninstallHandler function to uninstall a specific
handler, or you can use wildcards (VI_ANY_HNDLR in the
handler parameter) to uninstall groups of handlers. See
viUninstallHandler in the VISA Online Help for more details
on this function.
Writing the Handler
The handler installed needs to be written by the
programmer. The event handler typically reads an associated
attribute and performs some sort of action. See the event
handler in the sample program later in this section.
Enabling Events
Before an event can be delivered, it must be enabled using
the viEnableEvent function. This function causes the
application to be notified when the enabled event has
occurred, where the parameters are:
viEnableEvent(vi, eventType, mechanism,
context);
Using VI_QUEUE in the mechanism parameter specifies a
queuing method for the events to be handled. If you use
both VI_QUEUE and one of the mechanisms listed above,
notification of events will be sent to both locations. See the
next subsection for information on the queuing method.
Table 22 Description of Parameters Used to Install a Handler
Parameter Description
vi The session on which the handler will be installed.
eventType The type of event to enable.