BusSpeedNominal

This parameter is used to retrieve information about the currently used nominal CAN Bus speed, 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 4.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 nominal bit rate value from an USB Channel:

C#
uint bitrate;
PcanChannel channelUsed = PcanChannel.Usb01;

if (Api.Initialize(channelUsed, (BitrateFD)BitrateFD.BitrateSaeJ2284_4) == PcanStatus.OK)
{
    if (Api.GetValue(channelUsed, PcanParameter.BusSpeedNominal, out bitrate) == PcanStatus.OK)
        Console.WriteLine($"Nominal bit rate of channel {channelUsed} is {bitrate / 1000.0} kBit/s");
    else
        Console.WriteLine($"Error retrieving Bus Speed on channel {channelUsed}");
    Api.Uninitialize(channelUsed);
}

See Also