User`s guide
6 Acquiring Image Data
6-28
100
5
Clean up Always remove image acquisition objects from memory, and the variables
that reference them, when you no longer need them.
delete(vid)
clear vid
Determining How Many Frames Are Available
The FramesAcquired property tells how many frames the object has logged since it was
started, described in “Determining How Much Data Has Been Logged” on page 6-26.
Once you move frames from the memory buffer into the MATLAB workspace, the number
of frames stored in the memory buffer will differ from the FramesAcquired value. To
determine how many frames are currently available in the memory buffer, check the
value of the FramesAvailable property.
Note The FramesAvailable property tells the number of frames in the memory buffer,
not in the disk log, if LoggingMode is configured to 'disk' or 'disk&memory'. Because
it takes longer to write frames to a disk file than to memory, the number of frames stored
in the disk log might lag behind those stored in the memory buffer. To see how many
frames are available in the disk log, look at the value of the DiskLoggerFrameCount
property. See “Logging Image Data to Disk” on page 6-42 for more information.
This example illustrates the distinction between the FramesAcquired and the
FramesAvailable properties:
1
Create an image acquisition object — This example creates a video input object
for a Windows image acquisition device. To run this example on your system, use the
imaqhwinfo function to get the object constructor for your image acquisition device
and substitute that syntax for the following code.
vid = videoinput('winvideo',1);
2
Configure properties — For this example, configure an acquisition of 15 frames.
vid.FramesPerTrigger = 15
3
Start the image acquisition object — Call the start function to start the image
acquisition object.