Indicate the number of times the trigger executes in an operation


When working with the session-based interface, the TriggersPerRun property indicates the number of times the specified trigger executes for one acquisition or generation session.


Specify Number of Triggers Per Operation

Create a session and add channels and trigger to the session.

s = daq.createSession('ni');
addAnalogInputChannel(s,'Dev1', 0, 'voltage');
addAnalogInputChannel(s,'Dev2', 0, 'voltage');

Display Session’s TriggersPerRun Property.

ans =


Set the trigger to run twice during the operation.

s.TriggersPerRun = 2
s = 

Data acquisition session using National Instruments hardware:
   Will run 2 times for 1 second (1000 scans) at 1000 scans/second.

   Trigger Connection added. (Details)

   Number of channels: 2
      index Type Device Channel MeasurementType      Range       Name
      ----- ---- ------ ------- --------------- ---------------- ----
      1     ai   Dev1   ai0     Voltage (Diff)  -10 to +10 Volts
      2     ai   Dev2   ai0     Voltage (Diff)  -10 to +10 Volts