User`s guide
7 Using Events and Callbacks
Creating and Executing Callback Functions
In this section.. .
“Introduction” on page 7-12
“Creating C allback Functions” on page 7-12
“Specifying Callback Functions” on page 7-14
“Example: Viewing a Sample Frame” on page 7-16
“Example: Monitoring Memory Usage” on page 7 -17
Introduction
The power of using event callbacks is the proces sing that you can perform in
response to events. You decide which events you want to associate callbacks
with and the functions these callbacks execute.
This section
• Describes how to create a callback function
• Describes how to specify the function as the value of a callback p roperty
• Provides two examples of u sing event callbacks:
- Shows how to use callbacks to view a sample frame from the frames
being acquired
- Uses callback to implement a simple memory monitoring function
Note Callback function execution might be delayed if the callback involves
a CPU-intensive task such as updating a figure.
Creating Callback Functions
This section explains how to create callback functions for the TimerFcn,
FramesAcquiredFcn, StartFcn, StopFcn, TriggerFcn,andErrorFcn
callbacks.
7-12