HardResetStatus

This parameter allows changing the behavior of the method Reset. Normally, calling this method causes the receive and send message queues for a PCAN Channel to be emptied. The hardware being represented by the Channel is not reset. Activating this parameter, allows Reset to additionally perform a hardware reset after discarding the messages from the Channel’s queues.

  Important

Performing a hardware reset causes the CAN controller to go bus off for a while. This can disturb the CAN communication for a short time, generating error frames by other nodes, and avoiding sending/receiving messages.

Availability

Available since PCAN-Basic version 4.8.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 hard reset feature is Off. After switching it On, the hard reset will be performed by each call of Reset and 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 hard reset feature on a USB Channel:

C#
PcanChannel channelUsed = PcanChannel.Usb01;

if (Api.Initialize(channelUsed, Bitrate.Pcan500) == PcanStatus.OK)
{
    if (Api.SetValue(channelUsed, PcanParameter.HardResetStatus, ParameterValue.Activation.On) == PcanStatus.OK)
        Console.WriteLine($"The hard reset feature was successfully activated for {channelUsed}.");
    else
        Console.WriteLine($"Error enabling the hard reset feature for {channelUsed}.");
    Api.Uninitialize(channelUsed);
}

See Also