Main Content

triggerconfig

Configure video input object trigger properties

Syntax

triggerconfig(obj,type)
triggerconfig(obj,type,condition)
triggerconfig(obj,type,condition,source)
config = triggerconfig(obj)
triggerconfig(obj,config)

Description

triggerconfig(obj,type) configures the value of the TriggerType property of the video input object obj to the value specified by the character vector type. For a list of valid TriggerType values, use triggerinfo(obj). type must specify a unique trigger configuration.

obj can be either a single video input object or an array of video input objects. If an error occurs, any video input objects in the array that have already been configured are returned to their original configurations.

triggerconfig(obj,type,condition) configures the values of the TriggerType and TriggerCondition properties of the video input object obj to the values specified by the character vectors type and condition. For a list of valid TriggerType and TriggerCondition values, use triggerinfo(obj). type and condition must specify a unique trigger configuration.

triggerconfig(obj,type,condition,source) configures the values of the TriggerType, TriggerCondition, and TriggerSource properties of the video input object obj to the values specified by the character vectors type, condition, and source, respectively. For a list of valid TriggerType, TriggerCondition, and TriggerSource values, use triggerinfo(obj).

config = triggerconfig(obj) returns a MATLAB® structure config containing the object's current trigger configuration. obj must be a 1-by-1 video input object. The field names of config are TriggerType, TriggerCondition, and TriggerSource. Each field contains the current value of the object's property.

triggerconfig(obj,config) configures the TriggerType, TriggerCondition, and TriggerSource property values for video input object obj using config, a MATLAB structure with field names TriggerType, TriggerCondition, and TriggerSource, each containing the desired property value.

Note

To get a list of options you can use on a function, press the Tab key after entering a function on the MATLAB command line. The list expands, and you can scroll to choose a property or value. For information about using this advanced tab completion feature, see Using Tab Completion for Functions.

Examples

collapse all

  1. Construct a video input object.

    vid = videoinput('winvideo', 1);
  2. Configure trigger properties for the object.

    triggerconfig(vid, 'manual')
  3. Trigger the acquisition.

    start(vid)
    trigger(vid)
  4. Remove video input object from memory.

    delete(vid)
  1. Create a video input object.

    vid = videoinput('winvideo', 1);
  2. Use triggerinfo to get all valid configurations for the trigger properties for the object.

    config = triggerinfo(vid);
  3. Pass one of the configurations to the triggerconfig function.

    triggerconfig(vid,config(2));
  4. Remove video input object from memory.

    delete(vid)

Version History

Introduced before R2006a