User`s guide

8 Using Events and Callbacks
8-18
imaqhwinfo function to get the object constructor for your image acquisition device
and substitute that syntax for the following code.
vid = videoinput('matrox',1);
2
Configure property values — This example sets up a continuous acquisition
by setting the FramesPerTrigger value to Inf. The example also specifies the
timer event callback function mem_mon, created in “Creating the Memory Monitor
Callback Function” on page 8-17, as the value of the TimerFcn callback. The
object will execute the TimerFcn every five seconds, as specified by the value of the
TimerPeriod property.
vid.FramesPerTrigger = Inf;
vid.TimerPeriod = 5;
vid.TimerFcn = {'mem_mon'};
3
Acquire data — Start the video input object. Every 5 seconds, the object executes
the callback function associated with the timer event. This function outputs the
current memory available for frame storage and the memory load statistic. When the
amount of memory reaches the specified lower limit, the callback function stops the
acquisition.
start(vid)
ans =
ans =
Memory left for frames: 27791360
Memory load: 88
ans =
Memory left for frames: 26316800
Memory load: 88
ans =
Memory left for frames: 24842240
Memory load: 89
.
.
.
Memory left for frames: 2969600