> ## 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.

# CAPLfunctionFRSetExtOffsetRateControl

[Open topic with navigation](../../../../../CANoeDEFamily.htm#Topics/CAPLFunctions/FlexRay/Functions/CAPLfunctionFRSetExtOffsetRateControl.md)

**CAPL Functions** » **FlexRay** » **frSetExtOffsetRateControl**

# frSetExtOffsetRateControl

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

## Function Syntax

```plaintext theme={null}
int frSetExtOffsetRateControl(int aChannel, int aRateCtrl, int anOffsetCtrl);
```

## Description

Applies the external rate and offset correction values from the FlexRay parameters for the next cycle. For a description and explanation of the external clock correction procedure please refer to the FlexRay specification and/or to the user manual for the E-Ray communication controller.

The function is used in the following sample configuration:

**2 Cluster Gateway (FlexRay)** – **[FlexRay\_2Cluster\_Gateway.cfg](javascript:startCANoeLauncher\('"SAMPLES:\FlexRay\2Cluster_Gateway\FlexRay_2Cluster_Gateway.cfg"\)')**\
Demonstrates the simulation of two FlexRay networks that are interconnected by a FlexRay-FlexRay gateway.

## Parameters

* **aChannel**: FlexRay channel (cluster number)

* **aRateCtrl**: Controls whether the **rate correction** value is to be added, subtracted or ignored:

  * 1: add value
  * -1: subtract value
  * 0: ignore value

  The value referenced is **clusterCfg.pExternRateCorrection**, which can be read/set by the functions [frGetConfiguration](CAPLfunctionFRGetConfiguration.md) and [frSetConfiguration](CAPLfunctionFRSetConfiguration.md).

* **anOffsetCtrl**: Controls whether the offset correction value is to be added, subtracted or ignored:

  * 1: add value
  * -1: subtract value
  * 0: ignore value

  The value referenced is **clusterCfg.pExternOffsetCorrection**, which can be read/set by functions FRGetConfiguration and FRSetConfiguration.

## Return Values

* **0**: Success
* **Other**: Error

## Example

—

[frGetConfiguration](CAPLfunctionFRGetConfiguration.md) • [frSetConfiguration](CAPLfunctionFRSetConfiguration.md)
