Tip
The Api class offers a method as a shortcut for using these two parameters, GetAttachedChannels. Use this method instead for simplicity.
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.
It is available since version 4.4.0.
None Channel: The number of available Channels is not tied to any Channel, i.e. no specific Channel can be used for this query.
This parameter can only be read. It cannot be modified.
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.
Does not apply.
Get: Not relevant since this parameter does not depend on a specific Channel.
The following code shows how to get the amount of Channels attached to this PC:
uint channelsCount;
if (Api.GetValue(PcanChannel.None, PcanParameter.AttachedChannelsCount, out channelsCount) == PcanStatus.OK)
Console.WriteLine($"There are currently {channelsCount} channels attached to this PC.");Dim channelsCount As UInteger
If Api.GetValue(PcanChannel.None, PcanParameter.AttachedChannelsCount, channelsCount) = PcanStatus.OK Then
Console.WriteLine($"There are currently {channelsCount} channels attached to this PC.")
End IfUInt32 channelsCount;
if (Api::GetValue(PcanChannel::None, PcanParameter::AttachedChannelsCount, channelsCount) == PcanStatus::OK)
Console::WriteLine("There are currently {0} channels attached to this PC.", channelsCount);