BusOffAutoReset

This parameter instructs the PCAN driver to automatically reset the CAN controller of a PCAN Channel when a bus-off state is detected. It can be used to avoid resetting a device manually, after it has reached a bus-off state, for instance, when an application should work unattended, and it is known that bus-off error may occur.

Availability

It is available since PCAN-Basic version 1.0.0.

Supported By

Access Mode

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

Possible Values

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

Default Value

The default state of the automatic bus-off reset is Off. After switching it On, the automatic reset stays active until it is expressly deactivated, or the Channel is disconnected, i.e., using the Uninitialize method.

Initialization Status

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

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

Example

The following code shows how to activate the automatic bus-off reset of a USB Channel:

C#
PcanChannel channelUsed = PcanChannel.Usb01;

if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
    if (Api.SetValue(channelUsed, PcanParameter.BusOffAutoReset, ParameterValue.Activation.On) == PcanStatus.OK)
        Console.WriteLine($"The automatic bus-off reset mechanism has been activated successfully for {channelUsed}.");
    else
        Console.WriteLine($"Error configuring the automatic reset on bus-off on channel {channelUsed}.");
    Api.Uninitialize(channelUsed);
}

See Also