| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Image Acquisition Toolbox |
| Contents | Index |
| Learn more about Image Acquisition Toolbox |
| On this page… |
|---|
Most trigger properties can be set using the same methods you use to set any other image acquisition object property: using the set function or referencing the property as you would a field in a structure. For example, you can use the set function to specify the value of the TriggerRepeat property, where vid is a video input object created using the videoinput function.
set(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 TriggerType, TriggerCondition, and TriggerSource properties. For example, some TriggerCondition values are only valid when the value of the TriggerType property is 'hardware'.
Setting the values of the TriggerType, TriggerSource, and TriggerCondition properties can be a two-step process:
Determine valid configurations of these properties by calling the triggerinfo function.
Set the values of these properties by calling the triggerconfig function.
For an example of using these functions, see Example: Using a Hardware Trigger.
To find all the valid configurations of the TriggerType, TriggerSource, and TriggerCondition properties, use the triggerinfo function, 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'Note The text strings used as the values of the TriggerCondition and TriggerSource properties are device specific. Your device, if it supports hardware triggers, might support different condition and source values. |
To set the values of the TriggerType, TriggerSource, and TriggerCondition properties, you must use the triggerconfig function. 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.
triggerconfig(vid,'hardware','risingEdge','TTL')
If you are specifying a manual trigger, you only need to specify the trigger type value as an argument.
triggerconfig(vid,'manual')
You can also pass one of the structures returned by the triggerinfo function to the triggerconfig function and set all three properties at once.
triggerconfig(vid, config(1))
See the triggerconfig function documentation for more information.
![]() | Data Logging | Specifying the Trigger Type | ![]() |

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 |