Products & Services Solutions Academia Support User Community Company

Learn more about Image Acquisition Toolbox   

wait - Wait until image acquisition object stops running or logging

Syntax

wait(obj)
wait(obj,waittime)
wait(obj,waittime,state)

Description

wait(obj) blocks the MATLAB command line until the video input object obj stops running (Running = 'off'). obj can be either a single video input object or an array of video input objects. When obj is an array of objects, the wait function waits until all objects in the array stop running. If obj is not running or is an invalid object, wait returns immediately. The wait function can be useful when you want to guarantee that data is acquired before another task is performed.

wait(obj,waittime) blocks the MATLAB command line until the video input object or array of objects obj stops running or until waittime seconds have expired, whichever comes first. By default, waittime is set to the value of the object's Timeout property.

wait(obj,waittime,state) blocks the MATLAB command line until the video input object or array of objects obj stops running or logging, or until waittime seconds have expired, whichever comes first. state can be either of the following text strings. The default value is enclosed in braces ({}).

State

Description

{'running'}

Blocks until the value of the object's Running property is 'off'.

'logging'

Blocks until the value of the object's Logging property is 'off'.

An image acquisition object stops running or logging when one of the following conditions is met:

Examples

Create a video input object.

vid = videoinput('winvideo');

Specify an acquisition that should take several seconds. The example sets the FramesPerTrigger property to 300.

vid.FramesPerTrigger = 300;

Start the object. Because it is configured with an immediate trigger (the default), acquisition begins when the object is started. The example calls the wait function after calling the start function. Notice how wait blocks the MATLAB command line until the acquisition is complete.

start(vid), wait(vid);

See Also

imaqhelp, start, stop, trigger, propinfo

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS