ListenOnly

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.

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.

  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.

Possible Values

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

Default Value

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.

Initialization Status

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

Set: This parameter can be used in initialized or uninitialized Channels.

Example

The following code shows how to enable the listen-only mode in a USB Channel:

C#
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}.");

See Also