User`s guide
46 Agilent VISA User’s Guide
3 Programming with VISA
Using Events and Handlers
This section provides guidelines to using events and handlers,
including:
• Events
and Attributes
• Usin
g the Callback Method
• Usin
g the Queuing Method
Events and Attributes
Events are special occurrences that require attention from your
application. Event types include Service Requests (SRQs), interrupts,
and hardware triggers. Events will not be delivered unless the
appropriate events are enabled.
Event Notification
There are two ways you can receive notification that an event has
occurred:
• Ins
tall an event handler with viInstallHandler, and enable one or
several events with viEnableEvent. If the event was enabled with a
handler, the specified event handler will be called when the specified
event occurs. This is called a callback.
VISA cannot call back to a Visual Basic function. This means that you
can onl
y use the VI_QUEUE mechanism in viEnableEvent. There is
no way to install a VISA event handler in Visual Basic.
• Enable
one or several events with viEnableEvent and call the
viWaitOnEvent function. The viWaitOnEvent function will
suspend the program execution until the specified event occurs or the
specified timeout period is reached. This is called queuing.
NOTE
VISA cannot call back to a Visual Basic function. Thus, you can only
use the queuing mechanism in viEnableEvent. There is no way to
install a VISA event handler in Visual Basic.
NOTE