Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 
makenames    Examples   See Also

Generate a list of channel or line names.

Syntax

names = makenames('prefix', index);

Arguments

prefix
The string to append to the front of index.
index
Numbers appended to the end of prefix. Any MATLAB vector syntax can be used to specify index. The numbers must be positive.
names
An n-by-1 cell array of channel names where n is the length of index.

Description

makenames generates a list of channel or line names. This list is to be passed as an input argument to the addchannel or addline function. The names are constructed by concatenating prefix and an index value. prefix must begin with a character and contain only characters and numbers. The number of hardware channels specified in addchannel or hardware lines specified in addline should agree with the number of indices specified in makenames.

Although makenames does not provide much flexibility in the descriptive names you can assign to channels or lines, it does provide you with a quick way to name a large number of channels or lines.

Example

National Instruments

Suppose you create the analog input object AI for a National Instruments board and add eight input channels. You can use the makenames function to define descriptive names for each channel.

names is an 8-element cell array of channel names chan1, chan2, . . ., chan8. You can now pass names as an input argument to the addchannel function.

See Also

Functions

addchannel, addline



[ Previous | Help Desk | Next ]