User`s guide

Controlling Logging Parameters
6-27
Acquiring 100 Frames
This example illustrates how you can specify the amount of data to be acquired and
determine how much data has been acquired. (For an example of configuring a time-
based acquisition, see “Acquiring 10 Seconds of Image Data” on page 7-5.)
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 — Specify the amount of data you want to acquire as the
number of frames per trigger. By default, a video input object acquires 10 frames per
trigger. For this example, set the value of this property to 100.
vid.FramesPerTrigger = 100
3
Start the image acquisition object -— Call the start function to start the image
acquisition object.
start(vid)
The object executes an immediate trigger and begins acquiring frames of data. To
verify if the video input object is logging data, use the islogging function.
islogging(vid)
ans =
1
The start function returns control to the command line immediately but the object
continues logging the data to the memory buffer. After acquiring the specified
number of frames, the object stops running and logging.
4
Check how many frames have been acquired — To verify that the
specified number of frames has been acquired, check the value of the
FramesAcquired property. Note that the object continuously updates the value of
the FramesAcquired property as the acquisition progresses. If you view the value of
this property several times during an acquisition, you can see the number of frames
acquired increase until logging stops.
vid.FramesAcquired
ans =