User`s guide
Starting and Stopping a Video Input Object
5-23
The following example illustrates starting and stopping an object:
1
Create an image acquisition object — This example creates a video input object
for a webcam 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
Verify that the image is in a stopped state — Use the isrunning function to
determine the current state of the video input object.
isrunning(vid)
ans =
0
3
Configure properties To illustrate object states, set the video input object's
TriggerType property to 'Manual'. To set the value of certain trigger properties,
including the TriggerType property, you must use the triggerconfig function.
See “Setting the Values of Trigger Properties” on page 6-6 for more information.
triggerconfig(vid, 'Manual')
Configure an acquisition that takes several seconds so that you can see the video
input in logging state.
vid.FramesPerTrigger = 100;
4
Start the image acquisition object — Call the start function to start the image
acquisition object.
start(vid)
5
Verify that the image is running but not logging — Use the isrunning and
islogging functions to determine the current state of the video input object. With
manual triggers, the video input object is in running state after being started but
does not start logging data until a trigger executes.
isrunning(vid)
ans =
1