ChannelName

Specify descriptive channel name

Description

ChannelName specifies a descriptive name for a hardware channel. If a channel name is defined, then you can reference that channel by its name. If a channel name is not defined, then the channel must be referenced by its index. Channel names are not required to be unique.

You can also define descriptive channel names when channels are added to a device object with the addchannel function.

Characteristics

Usage

AI, AO, per channel

Access

Read/write

Data type

String

Read-only when running

Yes

Values

The default value is an empty string. To reference a channel by name, it must contain only letters, numbers, and underscores and must begin with a letter.

Examples

Create the analog input object ai for a sound card and add two channels to it.

ai = analoginput('winsound');
addchannel(ai,1:2);

To assign a descriptive name to the first channel contained by ai:

Chan1 = ai.Channel(1)
Chan1.ChannelName = 'Joe'

You can now reference this channel by name instead of by index.

ai.Joe.Units = 'Decibels'

See Also

Functions

addchannel

Was this topic helpful?