Setting the Values of Trigger Properties
About Trigger Properties
Most trigger properties can be set in the same way you set any
other image acquisition object property: referencing the property
as you would a field in a structure using dot notation. For example,
you can specify the value of the
vid is a video input object created using
vid.TriggerRepeat = Inf
For more information, see Configuring Image Acquisition Object Properties.
Some trigger properties, however, are interrelated and require
the use of the
triggerconfig function to set their
values. These properties are the
TriggerSource properties. For example, some
are only valid when the value of the
Specifying Trigger Type, Source, and Condition
Setting the values of the
TriggerCondition properties can be a two-step
Determine valid configurations of these properties by calling the
Set the values of these properties by calling the
For an example of using these functions, see Using a Hardware Trigger.
Determining Valid Configurations
To find all the valid configurations of the
TriggerCondition properties, use the
specifying a video input object as an argument.
config = triggerinfo(vid);
This function returns an array of structures, one structure for each valid combination of property values. Each structure in the array is made up of three fields that contain the values of each of these trigger properties. For example, the structure returned for an immediate trigger always has these values:
TriggerType: 'immediate' TriggerCondition: 'none' TriggerSource: 'none'
A device that supports hardware configurations might return the following structure.
TriggerType: 'hardware' TriggerCondition: 'risingEdge' TriggerSource: 'TTL'
The character vectors used as the values of the
are device specific. Your device, if it supports hardware triggers,
might support different condition and source values.
Configuring Trigger Type, Source, and Condition Properties
To set the values of the
TriggerCondition properties, you must use the
You specify the value of the property as an argument to the function.
For example, this code sets the values of these properties for a hardware trigger.
If you are specifying a manual trigger, you only need to specify the trigger type value as an argument.
You can also pass one of the structures returned by the
triggerconfig function and set all three
properties at once.
documentation for more information.
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.