Important
On PCAN-LAN Channels, the listen-only mode cannot be configured over this parameter. It can only be changed directly on the device, by using its configuration interface.
This parameter allows the user to set the hardware represented by a PCAN Channel in listen-only mode. When this mode is active, the CAN controller doesn't take part on active events (e.g., transmitting CAN messages) but remains in a passive mode (CAN monitor), in which it can analyze the traffic on the CAN bus. See also Philips Data Sheet SJA1000 Stand-alone CAN-controller.
This is a so called “preset parameter", which means that it can be configured before a PCAN Channel is initialized. This allow the activation or deactivation of a parameter as fast as possible, avoiding in this way problems that can appear with sensitive operations.
This parameter is useful, if an application wants to passively inspect the data being transferred within a CAN network, without causing any disturbance to it.
It is available since PCAN-Basic version 1.0.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 listen-only mode is Off. After switching it On, the listen-only mode stays active until it is expressly deactivated, or the Channel is disconnected, i.e., using the Uninitialize method.
Get: This parameter can be used in initialized or uninitialized Channels.
Set: This parameter can be used in initialized or uninitialized Channels.
The following code shows how to enable the listen-only mode in a USB Channel:
PcanChannel channelUsed = PcanChannel.Usb01;
if (Api.SetValue(channelUsed, PcanParameter.ListenOnly, ParameterValue.Activation.On) == PcanStatus.OK)
Console.WriteLine($"The listen-only mode has been activated successfully for {channelUsed}.");
else
Console.WriteLine($"Error configuring the listen-only mode on channel {channelUsed}.");Dim channelUsed As PcanChannel = PcanChannel.Usb01
If Api.SetValue(channelUsed, PcanParameter.ListenOnly, ParameterValue.Activation.On) = PcanStatus.OK Then
Console.WriteLine($"The listen-only mode has been activated successfully for {channelUsed}.")
Else
Console.WriteLine($"Error configuring the listen-only mode on channel {channelUsed}.")
End IfPcanChannel channelUsed = PcanChannel::Usb01;
if (Api::SetValue(channelUsed, PcanParameter::ListenOnly, ParameterValue::Activation::On) == PcanStatus::OK)
Console::WriteLine("The listen-only mode has been activated successfully for {0}.", channelUsed);
else
Console::WriteLine("Error configuring the listen-only mode on channel {0}.", channelUsed);