User`s guide
7 Using Events and Callbacks
Event Types
Image Acquisition Toolbox supports several different types of events. Each
event type has an associated video input object property that you can use to
specify the function that e xecutes when the eve nt occurs.
This table lists the supported event ty pes, the name of the video input object
property associated w ith the event, a nd a brief description of the event.
For detailed inform ation about these callback propertie s, see the property
reference information in Chapter 14, “Properties — Alphabetical List”.
The toolbox generates a specific set of information for each event and stores
it in an event structure. To learn more about the contents of these event
structures and how to retrieve this information, see “Retrieving Event
Information” on page 7-7.
Events and Callback Function Properties
Event Callback Proper ty D es cription
Error
ErrorFcn
The toolbox generates an error event when a
run-time error occurs, such as a hardware error
or timeout. Run-time errors do not include
configuration errors such as setting an invalid
property value.
When an error event occurs,thetoolboxexecutes
the function specified by the
ErrorFcn property.
By default, the toolbox executes the default
callback function for this event,
imaqcallback,
which displays the error message at the MATLAB
command line.
Frames
Acquired
FramesAcquiredFcn
The toolbox generates a frames acquired event when
a specified number of frames have been acquired.
You use the
FramesAcquiredFcnCount property to
specif y thi s number.
When a frames acquired e vent occurs, the
toolbox executes the function specified by the
FramesAcquiredFcn property.
7-4