
Programming with VISA
3
Agilent VISA User’s Guide
55
.
.
viInstallHandler(vi, VI_EVENT_SERVICE_REQ,
my_handler, addr);
viEnableEvent(vi, VI_EVENT_SERVICE_REQ,
VI_HNDLR, VI_NULL);
.
/* your code here */
.
viDisableEvent(vi, VI_EVENT_SERVICE_REQ,
VI_HNDLR);
viUninstallHandler(vi, VI_EVENT_SERVICE_REQ,
my_handler, addr);
.
}
Installing Handlers
VISA allows applications to install multiple handlers for an event type
on the same session. Multiple handlers can be installed through multiple
invocations of the
viInstallHandler
operation, where each invocation
adds to the previous list of handlers.
If more than one handler is installed for an event type, each of the
handlers is invoked on every occurrence of the specified event(s). VISA
specifies that the handlers are invoked in Last In First Out (LIFO) order.
Use the following function when installing an event handler:
viInstallHandler(
vi
,
eventType
,
handler
,
userHandle
);
These parameters are defined as follows.
Table 16
Parameters Used to Install a Handler
Parameter
Description
vi
The session on which the handler will be installed.
eventType
The event type that will activate the handler.
handler
The name of the handler to be called
.
userHandle
A user value that uniquely identifies the handler for the
specified event type.
Summary of Contents for E2094S
Page 6: ...6 Agilent VISA User s Guide ...
Page 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Page 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Page 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...