Connections
Array of connections in session
Description
This session property contains and displays all connections added to the session.
Tip
You cannot directly add or remove connections using the Connections
object
properties. Use addTriggerConnection
and addClockConnection
to add connections. Use removeConnection
to remove connections.
Values
The value is determined by the connections you add to the session.
Examples
Remove Synchronization Connection
This example shows you how to remove a synchronization connection.
Create a session and add analog input channels and trigger and clock connections.
s = daq.createSession('ni') addAnalogInputChannel(s,'Dev1', 0, 'voltage'); addAnalogInputChannel(s,'Dev2', 0, 'voltage'); addAnalogInputChannel(s,'Dev3', 0, 'voltage'); addTriggerConnection(s,'Dev1/PFI4','Dev2/PFI0','StartTrigger'); addTriggerConnection(s,'Dev1/PFI4','Dev3/PFI0','StartTrigger'); addClockConnection(s,'Dev1/PFI5','Dev2/PFI1','ScanClock');
Examine the session Connections property.
s.Connections
ans = Start Trigger is provided by 'Dev1' at 'PFI4' and will be received by: 'Dev2' at terminal 'PFI0' 'Dev3' at terminal 'PFI0' Scan Clock is provided by 'Dev1' at 'PFI5' and will be received by: 'Dev2' at terminal 'PFI1' 'Dev3' at terminal 'PFI1' index Type Source Destination ----- ------------ --------- ----------- 1 StartTrigger Dev1/PFI4 Dev2/PFI0 2 StartTrigger Dev1/PFI4 Dev3/PFI0 3 ScanClock Dev1/PFI5 Dev2/PFI1 4 ScanClock Dev1/PFI5 Dev3/PFI1
Remove the last clock connection at index 4 and display the session connections.
removeConnection(s,4) s.Connections
ans = Start Trigger is provided by 'Dev1' at 'PFI4' and will be received by: 'Dev2' at terminal 'PFI0' 'Dev3' at terminal 'PFI0' Scan Clock is provided by 'Dev1' at 'PFI5' and will be received by 'Dev2' at terminal 'PFI1'. index Type Source Destination ----- ------------ --------- ----------- 1 StartTrigger Dev1/PFI4 Dev2/PFI0 2 StartTrigger Dev1/PFI4 Dev3/PFI0 3 ScanClock Dev1/PFI5 Dev2/PFI1