> ## Documentation Index
> Fetch the complete documentation index at: https://notevil.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CAPLfunctionIso11783ILOnRxMessage

[Open topic with navigation](../../../../../../CANoeDEFamily.htm#Topics/CAPLFunctions/ISO11783/ISOInteractionLayer/Functions/CAPLfunctionIso11783ILOnRxMessage.md)

**CAPL Functions** » [ISO11783](../../CAPLfunctionsISO11783Overview.md) » [ISO11783 Interaction Layer](../CAPLfunctionsISOILOverview.md) » Iso11783IL\_OnRxMessage

# Iso11783IL\_OnRxMessage (Callback)

[Valid for](../../../../Shared/FeatureAvailability.md): CANoe DE • CANoe4SW DE

## Function Syntax

```plaintext theme={null}
long Iso11783IL_OnRxMessage( pg * rxPG );
```

## Description

This callback function is called from the Iso11783 IL if the Iso11783 IL receives the parameter group, namely **before** the parameter group is processed by the Iso11783 IL. The message data can be manipulated in the callback method or handling of the message by the IL can be suppressed.

**Usage**

* To ignore some incoming messages;
* To simulate faulty behavior of the node that communicates with simulated node (by manipulating of incoming messages);
* To send the ObjectPool not to the first discovered, but to the specific Virtual Terminal

## Parameters

* **rxPG**: Message which is received

## Return Values

* **0**: Received parameter group will be ignored by the ISO11783 Interaction Layer
* **1**: Received parameter group will be processed by the ISO11783 Interaction Layer

## Example

The following example ignores messages from a Virtual Terminal e.g. to communicate with a second Virtual Terminal.

```plaintext theme={null}
LONG Iso11783IL_OnRxMessage ( pg * rxPG )
{
  if( (rxPG.PGN == VT12_VT.pgn) && (txPG.sa == 38))
    return 0;
  return 1;
}
```

The following example blocks the RQST of the pgn = 0x5\*\* (case 5) and replace the RQST of the pgn = 0x3\*\* by the RQST of the pgn = 0x4\*\* (case 3)

```plaintext theme={null}
long Iso11783IL_OnRxMessage( pg * rxPG )
{
  if(rxPG.PGN == 0xEA00)
  {
    switch(rxPG.BYTE(1))
    {
      case 3:
        rxPG.BYTE(1) = 4;
        return 1;
      case 5:
        return 0;
      default:
        return 1;
    }
  }
  return 1;
}
```
