ChannelIdentifying

This parameter is used to physically identify an USB-based PCAN Channel being used. The identification is done using the status LED of the USB devices.

  Note

  • The activation of this identification procedure doesn’t affect any communication that can occur on the device while it is being identified.

  • The identification of only one channel can be activated at a time. To activate the identification procedure on another channel, the previous one must first be deactivated.

At the moment PEAK-System offers USB devices of three different generations:

  • First Generation: PCAN-USB, PCAN-Hub.

  • Second Generation: PCAN-USB Pro, PCAN-USB2.

  • Third Generation: PCAN-USB Classic, PCAN-USB FD, PCAN-USB Pro FD.

According with the hardware used, the blinking of the LED is different in color and blink rate:

  • First Generation: Blink color is RED, and the blink rate is about 300 milliseconds.

  • Second Generation: Blink color is ORANGE, and the blink rate is about 250 milliseconds.

  • Third Generation: Blink color is ORANGE, and the blink rate is about 250 milliseconds.

This parameter is useful when an application can connect to several USB devices and it is not clear which (physical) Channel must be used. It is also useful to physically determine which Channel is being used by an application in a determined time.

Availability

Available since PCAN-Basic version 1.3.0.

Supported By

Access Mode

This parameter is read/write. It can be configured and retrieved.

Possible Values

This parameter represents a procedure that can be activated or deactivated. Accepts values of type ParameterValueActivation.

Default Value

The default state of this identification procedure is Off. After switching it On, the LED of an USB device stays blinking until it is expressly turned off.

Initialization Status

Get: This parameter can be used on both, initialized and uninitialized PCAN Channels.

Set: This parameter can be used on both, initialized and uninitialized PCAN Channels.

Example

The following code shows how to physically identify a USB Channel:

C#
PcanChannel[] channelsToIdentify = { PcanChannel.Usb01, PcanChannel.Usb02, PcanChannel.Usb03 };

for (int i = 0; i < 3; i++)
{
    if (Api.SetValue(channelsToIdentify[i], PcanParameter.ChannelIdentifying, ParameterValue.Activation.On) == PcanStatus.OK)
    {
        Console.Write($"The channel {channelsToIdentify[i]} is now blinking . . . ");
        Console.WriteLine("Press any Key to continue . . .");
        Console.ReadKey();
        if (Api.SetValue(channelsToIdentify[i], PcanParameter.ChannelIdentifying, ParameterValue.Activation.Off) != PcanStatus.OK)
            Console.WriteLine("Error trying to deactivate the identification process.");
    }
    else
        Console.WriteLine($"Error trying to activate the identification process on Channel {channelsToIdentify[i]}.");
}

See Also