Main Content

removeConnection

(Not recommended) Remove clock or trigger connection

This session object function is not recommended. Use DataAcquisition object functions instead. See Compatibility Considerations.

Description

example

removeConnection(s,idx) removes the specified clock or trigger with the index idx, from the session. The connected device remains in the session, but is no longer synchronized with other connected devices in the session.

Examples

collapse all

Create clock and trigger connection in the session s.

s = daq.createSeion('ni');
addAnalogInputChannel(s,'Dev1','ai0','Voltage')
addAnalogInputChannel(s,'Dev2','ai0','Voltage')
addAnalogInputChannel('Dev3','ai0','Voltage')
addTriggerConnection(s,'Dev1/PFI0',{'Dev2/PFI0','Dev3/PFI0'}','StartTrigger');
addClockConnection(s,'Dev1/PFI1',{'Dev2/PFI1','Dev3/PFI1'},'ScanClock');

View existing synchronization connection.

s.Connections
ans= 


Start Trigger is provided by 'Dev1' at 'PFI0' and will be received by:
         'Dev2' at terminal 'PFI0'
         'Dev3' at terminal 'PFI0'
Scan Clock is provided by 'Dev1' at 'PFI1' and will be received by:
         'Dev2' at terminal 'PFI1'
         'Dev3' at terminal 'PFI1'

   index     Type      Source   Deination
   ----- ------------ --------- -----------
   1     StartTrigger Dev1/PFI0 Dev2/PFI0
   2     StartTrigger Dev1/PFI0 Dev3/PFI0
   3     ScanClock    Dev1/PFI1 Dev2/PFI1
   4     ScanClock    Dev1/PFI1 Dev3/PFI1

Remove the trigger connection with the index 2 from Dev3/PFI0 to Dev1/PFI0:

removeConnection(s,2);

View updated connection

s.Connections
an= 


Start Trigger is provided by 'Dev1' at 'PFI0' and will be received by 
'Dev2' at terminal 'PFI0'.
Scan Clock is provided by 'Dev1' at 'PFI1' and will be received by:
         'Dev2' at terminal 'PFI1'
         'Dev3' at terminal 'PFI1'

   index     Type      Source   Deination
   ----- ------------ --------- -----------
   1     StartTrigger Dev1/PFI0 Dev2/PFI0
   2     ScanClock    Dev1/PFI1 Dev2/PFI1
   3     ScanClock    Dev1/PFI1 Dev3/PFI1

Notice that the connections are re-indexed.

Input Arguments

collapse all

Data acquisition session, specified as a session object. Create the session object using daq.createSession. Use the data acquisition session for acquisition and generation operations. Create one session per vendor and use that vendor session to perform all data acquisition operations.

Index of the connection you want to remove, specified as a numeric value.

Version History

Introduced in R2012a

collapse all

R2020a: session object interface is not recommended

Use of this function with a session object is not recommended. To access a data acquisition device, use a DataAcquisition object with its functions and properties instead.

For more information about using the recommended functionality, see Transition Your Code from Session to DataAcquisition Interface.