The Image Acquisition Toolbox™ software 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 executes when the event occurs.
This table lists the supported event types, the name of the video input object property associated with the event, and a brief description of the event. For detailed information about these callback properties, see the property reference list in Image Acquisition Toolbox Properties.
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.
Events and Callback Function Properties
When an error event occurs, the toolbox executes 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.
When a frames acquired event occurs, the toolbox executes the function specified by the FramesAcquiredFcn property.
When a start event occurs, the toolbox executes the function specified by the StartFcn property.
The toolbox generates a stop event when the object stops running. An object stops running when the stop function is called, the specified number of frames is acquired, or a run-time error occurs.
When a stop event occurs, the toolbox executes the function specified by the StopFcn property.
The toolbox generates a timer event when a specified amount of time expires. Time is measured relative to when the object starts running. You use the TimerPeriod property to specify the amount of time.
The toolbox generates a trigger event when a trigger executes. The video input object executes immediate triggers. You execute manual triggers by calling the trigger function. The image acquisition device executes hardware triggers when a specified condition is met.
When a trigger event occurs, the toolbox executes the function specified by the TriggerFcn property.