User`s guide
Waiting for an Acquisitio n to Finish
Waiting for an Acquisition to Finish
In this section.. .
“Using the wait Function” on page 5-31
“Example: Blocking the Command Line Until an Acquisition Completes”
on page 5-32
Using the wait Function
The start function and the trigger function are asynchronous functions.
That is, they start the acquisition of frames and return control to the
MATLAB command line immediately.
In some sce n arios, you might want your application to wait until the
acquisition completes befo re proceeding with other processing. To do this, call
the
wait function immediately after the start or trigger function returns.
The
wait function blocks the MATLAB command line until an acquisition
completes or a time out value expires, whichever comes first.
By default,
wait blocks the comm and line until a video input object stops
running. You can optionally specify that
wait block the command line until
the object stops logging. For acquisitions using an immediate trigger, video
input objects always stop running and stop logging at the same time. However,
with a manual trigger configured for multiple executions (
TriggerRepeat >
0), y ou can use
wait immediately after each call to the trigger function to
block the command line while logging is in progress, even though the object
remains in running state throughout the entire acquisition.
The following figure illustrates the flow of control at the MATLAB command
line for a single execution of an immediate trigger and a manual trigger, w ith
and without the
wait function. A hardware trigger is similar to the manual
trigger dia gra m, exce pt that the acqu isition is triggered by an external signal
to the camera or frame grabber board, not by the
trigger function. For an
example, see “Example: Blocking the Command Line Until an Acquisition
Completes” on page 5-32.
5-31