Quantcast

Documentation Center

  • Trial Software
  • Product Updates

muxchanidx

Multiplexed scanned analog input channel index

Syntax

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.

Arguments

obj

An analog input object associated with a National Instruments® Traditional NI-DAQ board.

muxboard

The multiplexer board.

muxidx

The index number of the multiplexed channel.

absmuxidx

The absolute index number of the multiplexed channel.

scanidx

The scanning index number of the multiplexed channel.

Description

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.

scanidx = muxchanidx(obj,absmuxidx) returns the scanning index number of the multiplexed channel specified by absmuxidx. absmuxidx is the absolute index of the channel independent of the mux board.

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.

Examples

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);

More About

expand all

Tips

scanidx identifies the column number of the data returned by getdata and peekdata.

Refer to the AMUX-64T User Manual for more information about adding mux channels based on hardware channel IDs and the number of mux boards used.

See Also

Was this topic helpful?