ReceiveStatus

This parameter allows / disallows the reception of messages (Data, Status, and Error frames) of a PCAN Channel, regardless of the value of its acceptance filter. The acceptance filter of the PCAN Channel remains unchanged (other applications working with the same hardware will not be disturbed).

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 for applications that want to discard messages for a while, without having to take modifications on the message filter, avoiding in this form disturbances that may arise when an acceptance filter is changed.

Availability

It is available since PCAN-Basic version 1.1.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 receive status is On. After switching it Off, the receiving status stays inactive until it is expressly reactivated, or the Channel is disconnected, i.e., using the Uninitialize method.

Initialization Status

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

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

Example

The following code shows how to disable receiving messages on a USB Channel:

C#
PcanChannel channelUsed = PcanChannel.Usb01;

if (Api.SetValue(channelUsed, PcanParameter.ReceiveStatus, ParameterValue.Activation.Off) == PcanStatus.OK)
    Console.WriteLine($"The {channelUsed} was successfully configured to disallow incoming messages.");
else
    Console.WriteLine($"Error configuring the receive status on channel {channelUsed}.");

See Also