Main Content

trigger

Initiate data logging

Description

trigger(videoinput) initiates data logging for the videoinput object. The trigger function:

  • Executes the TriggerFcn callback of the object.

  • Records the absolute time of the first trigger event in the InitialTriggerTime property of the object.

  • Configures the Logging property of the object to "On".

example

Examples

collapse all

Construct a video input object.

vid = videoinput("winvideo",1);

Configure the trigger properties for the object by setting the trigger type to "manual". When you set the trigger type to "manual", data logging occurs when you call the trigger function..

triggerconfig(vid,"manual")

Start the videoinput object to acquire image data, pause for 5 seconds, and then display the number of acquired frames. Observe that no frames are acquired.

start(vid)
pause(5)
vid.FramesAcquired
ans = 
0

Trigger the acquisition, wait until the image acquisition stops, and then display the number of acquired frames. Observe that 10 frames are acquired.

trigger(vid)
wait(vid)
vid.FramesAcquired
ans = 
10

Remove the videoinput object from memory.

delete(vid)

Input Arguments

collapse all

Video input, specified as a single videoinput object or an array of videoinput objects. The videoinput object must be running and you must set its TriggerType property to "manual". To start an object running, use the start function. The EventLog property of the object records the trigger event.

Version History

Introduced before R2006a