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.
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.
Available since PCAN-Basic version 4.8.0.
This parameter is read/write. It can be configured and retrieved.
This parameter can be activated or deactivated. Accepts values of type ParameterValueActivation.
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.
Get: The PCAN Channel must be initialized before using this parameter.
Set: The PCAN Channel must be initialized before using this parameter.
The following code shows how to activate the hard reset feature on a USB Channel:
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);
}Dim channelUsed As PcanChannel = PcanChannel.Usb01
If Api.Initialize(channelUsed, Bitrate.Pcan500) = PcanStatus.OK Then
If Api.SetValue(channelUsed, PcanParameter.HardResetStatus, ParameterValue.Activation.On) = PcanStatus.OK Then
Console.WriteLine($"The hard reset feature was successfully activated for {channelUsed}.")
Else
Console.WriteLine($"Error enabling the hard reset feature for {channelUsed}.")
End If
Api.Uninitialize(channelUsed)
End IfPcanChannel 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 {0}.", channelUsed);
else
Console::WriteLine("Error enabling the hard reset feature for {0}.", channelUsed);
Api::Uninitialize(channelUsed);
}