# null

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

**CAPL Functions** » [K-Line](../CAPLfunctionsKLineOverview.md) » KLine\_SetUARTParameter

# KLine\_SetUARTParameter

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

## Function Syntax

```plaintext
long KLine_SetUARTParameter(dword dataBits, dword parity, dword stopBits);
```

## Description

Configures the way bytes are sent on K-Line, by setting the parameters the UART (universal asynchronous receiver/transmitter) uses.

## Parameters

* **dataBits**: Number of bits a byte consists of. Possible values: 7, 8, 9. **Note:** 7 bits in a byte will not allow standard K-Line communication.
* **parity**: If a parity bit is used to indicate the number of bits set in the byte. **1** means *odd* and **2** *even* parity. A value of 0 indicates that no parity bit is used.
* **stopBits**: The number of stop bits that indicate the end of a byte. 1 or 2 is possible.

## Return Values

On success 0, otherwise [error code](../../Diagnostics/CAPLfunctionsDiagnosticsErrorCode.md).

## Example

```plaintext
KLine_CreateECURepresentation( gMsgChannel);
KLine_SetUARTParameter( 9, 1, 2); // 9 data bits, odd parity, 2 stop bits => 13 bit/byte (including start bit)
```

[KLine\_SetBaudrate](CAPLfunctionKLineSetBaudrate.md)
