Channel Groups

Channel Group Description

A simplified view of a DAQ device is that actual devices provide channels with common functions, logically grouped into subsystems. For example, all channels that provide analog input data may be thought of as belonging to an analog input subsystem.

Another view of this DAQ device is as a provider and consumer of data. The largest unit of data that can be acquired or generated simultaneously, by one or more channels, is a scan. The logical grouping that acquires or consumes one or more scans of data is a channel group. The definition of the channel group is usually constrained by the driver and hardware. For example, when all channels belonging to a single analog input subsystem also share a single clock.

A channel group is an aggregation of channels, usually of the same subsystem, which operate together. For example, all the analog output subsystem channels on a device must be configured, reserved, and act together to generate data as a single scan.

You should define channel groups in a way that reflects the driver constraints, and provide a means for identifying all channels belonging to the group for acquiring and generating scans. Typically, channel groups provide functions to stream data to or from a device buffer.

Each channel on the device has a unique address, defined by device, subsystem, and channel ID. Each channel must be assigned to one channel group. The following diagram illustrates one possible channel group arrangement. In this scenario, analog output (AO) channels 0 and 1 might serve a different purpose than AO channels 2 and 3; while analog input (AI) channels 0–3 are used all together.

For reference information on the functions used in configuring channel groups, see Hardware Management.

Channel Group Restrictions

  • All channels in a group operate together. This allows synchronized streaming to the extent supported by the hardware.

  • A channel cannot belong to more than one group.

  • All channels in a group are requested, reserved, and released together.

  • By default, a channel group—and therefore all its channels—can be accessed by only one data acquisition session at a time. You cannot add channels to a session if any other channels in their groups are already added to a different session. If your driver allows a group to be accessed by different sessions, you can control this behavior using the isRegistrationReservationImpl function.

Device Discovery

Device discovery occurs by calling daq.getDevices in a MATLAB session. Part of discovery is enumeration, whereby all devices and channels are indexed. The result of enumeration is a set of channel group handles, which the adaptor uses to address channels on the numerous devices of the session.

A channel group usually includes all the channels of one subsystem of one device, as shown in the following diagram. But other configurations are possible. For example, a channel group could include all channels of all subsystems in a single device, or all channels of the same type of subsystem across several devices.

This diagram illustrates the process of enumeration performed during daq.getDevices. Through the driver, the adaptor accesses the numerous supported devices, and determines their subsystems and channels. The adaptor then derives an absolute (unique) index for each channel, and assigns each to a channel group. Each channel group has an index, and a resulting unique channel group handle. Through these handles, the adaptor performs the operations of a data acquisition session.

You can create handles to any of the possible objects in your configuration, such as devices, channels, and subsystems, but the adaptor templates provided with Data Acquisition Toolbox use only channel group indices.

Related Topics