Specify channel serving as trigger source
Note: You cannot use the legacy interface on 64-bit MATLAB®. See Working with the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
TriggerChannel specifies the channel serving as the trigger source. The trigger channel must be specified before the trigger type. You might need to configure the TriggerCondition and TriggerConditionValue properties in conjunction with TriggerChannel.
For all supported vendors, if TriggerType is Software, then you must acquire data from the channel being used for the trigger source. For National Instruments® hardware, if TriggerType is HwAnalogChannel, then TriggerChannel must be the first element of the channel group. The exception is if you are using simultaneous acquisition devices such as the S-series boards, with which you can specify any channel for the TriggerChannel value.
AI, common to all channels
Vector or scalar
Read-only when running
The data type can be either vector or scalar, representing one channel. The default value is an empty vector.
Create the analog input object ai, add two channels, and define the trigger source as channel 2.
ai = analoginput('winsound'); ch = addchannel(ai,1:2); ai.TriggerChannel = ch(2) ai.TriggerType = 'Software'