Multiplexed scanned analog input channel index
scanidx = muxchanidx(obj,muxboard,muxidx) scanidx = muxchanidx(obj,absmuxidx)
Note: You cannot use the legacy interface on 64–bit MATLAB®. See Session-Based Interface to acquire and generate data.
An analog input object associated with a National Instruments® Traditional NI-DAQ board.
The multiplexer board.
The index number of the multiplexed channel.
The absolute index number of the multiplexed channel.
The scanning index number of the multiplexed channel.
scanidx = muxchanidx(obj,muxboard,muxidx) returns the scanning index number of the multiplexed channel specified by muxidx. The multiplexer (mux) board is specified by muxboard. For each mux board, muxidx can range from 0-31 for differential inputs and 0-63 for single-ended inputs. muxboard and muxidx are vectors of equal length.
For single-ended inputs, the first mux board has absolute index values that range between 0 and 63, the second mux board has absolute index values that range between 64 and 127, the third mux board has absolute index values that range between 128 and 191, the fourth mux board has absolute index values that range between 192 and 255. For example, the absolute index value of the second single-ended channel on the fourth mux board (muxboard is 4 and muxidx is 1) is 193.
Note: The Traditional NI-DAQ adaptor will be deprecated in a future version of the toolbox. If you create a Data Acquisition Toolbox™ object for Traditional NI-DAQ adaptor beginning in R2008b, you will receive a warning stating that this adaptor will be removed in a future release. See the supported hardware page at www.mathworks.com/products/daq/supportedio.html for more information.
Create the analog input object ai for a National Instruments board that is connected to four AMUX-64T multiplexers, and add 256 channels to ai using addmuxchannel.
ai = analoginput('nidaq',1); ai.InputType = 'SingleEnded'; ai.NumMuxBoards = 4; addmuxchannel(ai);
The following two commands return a scanned index value of 14.
scanidx = muxchanidx(ai,4,1); scanidx = muxchanidx(ai,193);