To help answer this question, we first need to define the three key types of attributes. The three types are Session, Device, and Channel attributes.
Session attributes apply to the whole session, and configure properties that are not device- or channel-specific. Example session attribute properties are Current Driver Version and Start Trigger Type.
Device attributes configure properties that may vary across devices in the session, but apply to the whole device regardless of the number of channels. This refers to properties such as Model and Reference Frequency Source.
Channel attributes can vary from channel to channel, whether on the same device or on different devices. A couple examples of this would be Gain and Carrier Frequency.
The Active Channel property in the property node allows you to specify the scope for all of the properties below the Active Channel. It can also be used to scope an attribute to a device or session. The Enabled Channels property actually specifies which channels in a multi-channel session you want to turn on for receiving/transmitting data.
Below are some other useful things to know regarding Session, Device, and Channel Attributes.
- On VIs that have the channel list terminal, that string means the same thing as Active Channel in the property node and can take the same values.
- Channels are uniquely numbered in monotonically increasing order in a session. For example:
- Single device, single channel (device name="192.168.10.2"): There is a single channel "0".
- Single device, multi-channel (device name="192.168.10.2"): There may be two channels, "0" and "1".
- Multi-device, single channel per device (device names="192.168.10.2;192.168.10.3"): The channel on the first device in the list is "0" and the channel on the second device is "1".
- Multi-device, multi-channel per device (device names="192.168.10.2;192.168.10.3"): The channels on the first devices in the list are "0" and "1" and the channels on the second device are "2" and "3".
- The Active Channel or channel list string allows you to scope attributes as specifically as you want to. For example, say you want to specify the gain differently on each channel:
- Multi-device, multi-channel per device session (device names="192.168.10.2;192.168.10.3")
- set Active Channel to "dev0/0"
- set Gain to 10 (sets gain on the first channel of device 192.168.10.2)
- set Active Channel to "dev1/3"
- set Gain to 20 (sets gain on the second channel of device 192.168.10.3)
- Since the channel numbers are unique, you can say either "dev0/0" or "0" and the driver will set the attribute on the appropriate channel.
- You can set multiple attributes at once by specifying a wider scope. Let's say you have a multi-device, multi-channel per device session. So the channels are "dev0/0", "dev0/1", "dev1/2", and "dev1/3":
- "dev0/0" : sets the gain only on that specific channel
- "dev0" : sets the gain on both channels of dev0 ("0" and "1")
- "" : sets the gain on all channels on all devices in the session ("0", "1", "2", and "3")
- You can set the Reference Frequency Source property with different scopes as described below.
- "dev0" : sets the reference only on the first device
- "" : sets the reference on all devices in the session
- Note: "dev0/0" doesn't make sense here because Reference Frequency Source is a device attribute and not a channel attribute.
- Similar rules apply to reading attribute values back, but this can be tricky. If you read an attribute with a wide scope (e.g. read Gain with a "" Active Channel) it will return a valid value ONLY if all of the channels in the session have the same value for that property. Otherwise, you get an error.
- Enabled Channels is a session attribute, so the Active Channel property should be "" or just not set at all.
- Suppose you have a multi-device, multi-channel per device session with channels "0", "1", "2", and "3". To enable only channels "0" and "2", set
- Active Channel = "" (applies to entire session)
- Enabled Channels = "0,2"