BusSpeedXl

This parameter is used to retrieve information about the currently used CAN bus speed for the XL phase (extended data-field length), in bits per second. It can be used to display a friendly bit rate value in an application that can be easily and quickly understood by any user.

Availability

It is available since PCAN-Basic version 5.0.0.

Supported By

Access Mode

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

Possible Values

This value has a resolution of Double-Word (range [0... MaxValue]).

Default Value

Does not apply.

Initialization Status

Get: The PCAN Channel must be initialized before using this parameter.

Example

The following code shows how to retrieve the friendly data bit rate value from a USB Channel:

C#
uint speed;
PcanChannel channelUsed = PcanChannel.Usb01;
BitrateXL bitrateXl = (BitrateXL)("f_clock=160000000, brp=1, nom_tseg1=255, nom_tseg2=64, nom_sjw=64, fd_tseg1=63, fd_tseg2=16, fd_sjw=16, fd_ssp_offset=0, xl_tseg1=10, xl_tseg2=9, xl_sjw=9, xl_ssp_offset=10, xl_error_signaling=1, xl_transceiver_mode_switch=0");

if (Api.Initialize(channelUsed, bitrateXl) == PcanStatus.OK)
{
    if (Api.GetValue(channelUsed, PcanParameter.BusSpeedXl, out speed) == PcanStatus.OK)
        Console.WriteLine($"XL bit rate of channel {channelUsed} is {speed / 1000000.0} MB/s");
    else
        Console.WriteLine($"Error retrieving Bus Speed on channel {channelUsed}");
    Api.Uninitialize(channelUsed);
}

See Also