Mouseover text to see original. Click the button below to return to the English version of the page.
Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.
Translate This Page
MathWorks Machine Translation
The automated translation of this page is provided by a general purpose third party translator tool.
MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.
Start with a session s,
to which you add two analog input and two analog output voltage channels
and display the channel information.
s
s =
Data acquisition session using National Instruments hardware:
No data queued. Will run at 1000 scans/second.
Operation starts immediately.
Number of channels: 4
index Type Device Channel MeasurementType Range Name
----- ---- --------- ------- ------------------- ---------------- ----
1 ai cDAQ1Mod4 ai0 Voltage (SingleEnd) -10 to +10 Volts
2 ai cDAQ1Mod4 ai1 Voltage (SingleEnd) -10 to +10 Volts
3 ao cDAQ1Mod2 ao0 Voltage (Diff) -10 to +10 Volts
4 ao cDAQ1Mod2 ao1 Voltage (Diff) -10 to +10 Volts
Remove channel 'ai0' with the index 1
from the session:
removeChannel(s,1)
To see how the indices shift after you remove a channel, type:
s
s =
Data acquisition session using National Instruments hardware:
No data queued. Will run at 1000 scans/second.
All devices synchronized using cDAQ1 CompactDAQ chassis backplane. (Details)
Number of channels: 3
index Type Device Channel MeasurementType Range Name
----- ---- --------- ------- ------------------- ---------------- ----
1 ai cDAQ1Mod4 ai1 Voltage (SingleEnd) -10 to +10 Volts
2 ao cDAQ1Mod2 ao0 Voltage (Diff) -10 to +10 Volts
3 ao cDAQ1Mod2 ao1 Voltage (Diff) -10 to +10 Volts
Remove the first output channel 'ao0' at index 2:
removeChannel(s,2);
The session now displays one input and one output channel:
s.Channels
ans =
Number of channels: 2
index Type Device Channel MeasurementType Range Name
----- ---- --------- ------- ------------------- ---------------- ----
1 ai cDAQ1Mod4 ai1 Voltage (SingleEnd) -10 to +10 Volts
2 ao cDAQ1Mod2 ao1 Voltage (Diff) -10 to +10 Volts
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.
idx — Index of channel numeric
Channel index, specified as a numeric value. Use the index of the channel that you want to
remove from the session.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.