Specify condition that must be satisfied before trigger executes
When working with the session-based interface, use the
to specify the signal condition that executes the trigger, which synchronizes
operations on devices in a session. For more information, see Synchronization.
Set the trigger condition to
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'); addTriggerConnection(s,'Dev1/PFI4','Dev2/PFI0','StartTrigger');
Change the trigger condition to
connection = s.Connections(1) connection.TriggerCondition = 'FallingEdge'
s = Data acquisition session using National Instruments hardware: Will run 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
(Details) to see the connection
Start Trigger is provided by 'Dev1' at 'PFI4' and will be received by 'Dev2' at terminal 'PFI0'. TriggerType: 'Digital' TriggerCondition: FallingEdge Source: 'Dev1/PFI4' Destination: 'Dev2/PFI0' Type: StartTrigger