Data Acquisition Toolbox | ![]() ![]() |
Device-Specific Hardware Triggers
Many data acquisition devices possess the ability to accept a hardware trigger. Hardware triggers are processed directly by the hardware and can be either a digital signal or an analog signal. Hardware triggers are often used when speed is required because a hardware device can process an input signal much faster than software.
The device-specific hardware triggers are presented to you as additional property values. Hardware triggers for Agilent Technologies, Measurement Computing, and National Instruments devices are discussed below and in Base Property Reference.
Note that the available hardware trigger support depends on the board you are using. Refer to your hardware documentation for detailed information about its triggering capabilities.
Agilent Technologies
When using Agilent Technologies hardware, there are additional trigger types and trigger conditions available to you. These device-specific property values fall into two categories: hardware digital triggering and hardware analog triggering.
The device-specific trigger types and trigger conditions are described below and in Base Property Reference.
Note that when TriggerType
is HwAnalog
, the trigger condition values are all specified as two-element vectors. Setting two trigger levels prevents the module from triggering repeatedly because of a noisy signal.
Hardware Digital Triggering. If TriggerType
is HwDigital
, the trigger is given by a digital (TTL) signal. For example, to trigger your acquisition when the negative edge of a digital signal is detected
ai = analoginput('hpe1432',8); addchannel(ai,1:16); set(ai,'TriggerType','HwDigital'); set(ai,'TriggerCondition','NegativeEdge');
Hardware Analog Triggering. If TriggerType
is HwAnalog
, the trigger is given by an analog signal. For example, to trigger your acquisition when the trigger signal is between -4 volts and 4 volts
ai = analoginput('hpe1432',8); addchannel(ai,1:16); set(ai,'TriggerType','HwAnalog'); set(ai,'TriggerCondition','Entering'); set(ai,'TriggerConditionValue',[-4.0 4.0]); set(ai,'TriggerChannel',ai.Channel(1:4));
Measurement Computing
When using Measurement Computing hardware, there are additional trigger types and trigger conditions available to you. These device-specific property values fall into two categories: hardware digital triggering and hardware analog triggering.
The device-specific trigger types and trigger conditions are described below and in Base Property Reference.
Hardware Digital Triggering. If TriggerType
is HwDigital
, the trigger is given by a digital (TTL) signal. For example, to trigger your acquisition when the positive edge of a digital signal is detected:
ai = analoginput('mcc',1); addchannel(ai,0:7); set(ai,'TriggerType','HwDigital') set(ai,'TriggerCondition','TrigPosEdge')
The diagram below illustrates how you connect a digital trigger signal to a PCI-DAS1602/16 board. A/D External Trigger corresponds to pin 45.
Hardware Analog Triggering. If TriggerType
is HwAnalog
, the trigger is given by an analog signal. For example, to trigger your acquisition when the trigger signal is between -4 volts and 4 volts:
ai = analoginput('mcc',1); addchannel(ai,0:7); set(ai,'TriggerType','HwAnalog'); set(ai,'TriggerCondition','GateInWindow'); set(ai,'TriggerConditionValue',[-4.0 4.0]);
The diagram below illustrates how you connect an analog trigger signal to a PCI-DAS1602/16 board. AI Ch 0-7 corresponds to pins 2-17, while Analog Trigger In corresponds to pin 43.
National Instruments
When using National Instruments (NI) hardware, there are additional trigger types and trigger conditions available to you. These device-specific property values fall into two categories: hardware digital triggering and hardware analog triggering.
The device-specific trigger types and trigger conditions are described below and in Base Property Reference.
Hardware Digital Triggering. If TriggerType
is HwDigital
, the trigger occurs when the falling edge of a digital (TTL) signal is detected. The following example illustrates how to configure a hardware digital trigger.
The diagram below illustrates how you connect a digital trigger signal to an MIO-16E Series board. PFI0/TRIG1 corresponds to pin 11.
Hardware Analog Triggering. If TriggerType
is HwAnalogPin
, the trigger is given by a low-range analog signal (typically between -10 and 10 volts) connected to the appropriate trigger pin. For example, to trigger your acquisition when the trigger signal is between -4 volts and 4 volts:
ai = analoginput('nidaq',1); addchannel(ai,0:7); set(ai,'TriggerType','HwAnalogPin') set(ai,'TriggerCondition','InsideRegion') set(ai,'TriggerConditionValue',[-4.0 4.0])
If TriggerType
is HwAnalogChannel
, the trigger is given by an analog signal and the trigger channel is the first channel in the channel group (MATLAB index of one). The valid range of the analog trigger signal is given by the full-scale range of the trigger channel. The following example illustrates how to configure such a trigger where the trigger channel is assigned the descriptive name TrigChan
and the default TriggerCondition
property value is used.
ai = analoginput('nidaq',1); addchannel(ai,0:7); set(ai.Channel(1),'ChannelName','TrigChan') set(ai,'TriggerChannel',ai.Channel(1)) set(ai,'TriggerType','HwAnalogChannel') set(ai,'TriggerConditionValue',0.2)
The diagram below illustrates how you can connect an analog trigger signal to an MIO-16E Series board.
![]() | When Did the Trigger Occur? | Events and Callbacks | ![]() |