AttachedChannelsCount

This parameter is used to get information about the amount of PCAN Channels attached to a system in a single call. It is closely tied to another parameter, AttachedChannelsInformation, which returns an array containing further information about the Channels.

The information retrieved with this parameter is needed for building a buffer to use with the GetValue method, to retrieve further information about the available Channels.

  Tip

The Api class offers a method as a shortcut for using these two parameters, GetAttachedChannels. Use this method instead for simplicity.

Availability

It is available since version 4.4.0.

Supported By

  • None Channel: The number of available Channels is not tied to any Channel, i.e. no specific Channel can be used for this query.

Access Mode

This parameter can only be read. It cannot be modified.

Possible Values

A number in the range [0…n], where n is the sum of the maximum supported Channels per device. At the time of writing this documentation a maximum of 48 Channels can be handled simultaneously: 16 PCAN-PCI, 16 PCAN-USB, and 16 PCAN-LAN devices.

Default Value

Does not apply.

Initialization Status

Get: Not relevant since this parameter does not depend on a specific Channel.

Example

The following code shows how to get the amount of Channels attached to this PC:

C#
uint channelsCount;

if (Api.GetValue(PcanChannel.None, PcanParameter.AttachedChannelsCount, out channelsCount) == PcanStatus.OK)
    Console.WriteLine($"There are currently {channelsCount} channels attached to this PC.");

See Also