BitrateAdapting

This parameter allows the user to connect to an active PCAN Channel when the bit rate used is unknown. When this mode is set, PCAN-Basic will try first to use the bit rate given as parameter in the initialization process; if the Channel has a different bit rate configured, then the new connection will use the configured bit rate and the initialization function will return a warning value, indicating that the used bit rate differs from the given one.

This is a so called “preset-only parameter", which means that it can only be set on not yet initialized Channels.

This parameter is useful, when an application wants to connect to a Channel, without knowing its bit rate.

Availability

It is available since PCAN-Basic version 4.0.0.

Supported By

Access Mode

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

  Important

This parameter can only be configured on uninitialized Channels.

Possible Values

This parameter can be activated or deactivated. Accepts values of type ParameterValueActivation.

Default Value

The default state of the bit rate adapting mode is Off. This parameter has effect only at initialization time. It cannot be set after activating a Channel. The parameter returns to its default value after calling the Initialize method.

Initialization Status

Get: This parameter can be used on initialized or uninitialized Channels.

Set: This parameter can be used only on uninitialized Channels.

Example

The following code shows how to configure the bit rate adapting mode on a LAN Channel:

C#
PcanChannel channelUsed = PcanChannel.Lan01;

if (Api.SetValue(channelUsed, PcanParameter.BitrateAdapting, ParameterValue.Activation.On) == PcanStatus.OK)
    Console.WriteLine($"The bit rate adapting mode has been activated successfully for {channelUsed}.");
else
    Console.WriteLine($"Error configuring the bit rate adapting mode on channel {channelUsed}.");

See Also