# null

# DoIP\_SetVehicleLogicalAddress

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

**Note**

* [DoIP\_AddEcu](CAPLfunctionDoIPAddECU.md) and [DoIP\_AddTester](CAPLfunctionDoIPAddTester.md) may cause on receiver side the rejection of DoIP messages with unknown logical addresses (in principle a kind of filtering).
* [DoIP\_SetVehicleLogicalAddress](#) and [DoIP\_SetTesterLogicalAddress](CAPLfunctionDoIPSetTesterLogicalAddress.md) determine the logical addresses used when sending.

The following DoIP CAPL function is only available with the modeling library **DoIP.dll** and eventually an appropriate implementation of the CAPL Callback Interface. Information about the DoIP DLL and the CAPL Callback Interface you find here:

* [DoIP CAPL Introduction](../CAPLDiagnosticDoIP.md)
* [AN-IND-1-012\_CAPL\_Callback\_Interface.pdf](javascript:startDemoLoader\('AN-IND-1-012_CAPL_Callback_Interface.pdf'\))
* [AN-IND-1-026\_DoIP\_in\_CANoe.pdf](javascript:startDemoLoader\('AN-IND-1-026_DoIP_in_CANoe.pdf'\))

## Function Syntax

```plaintext
void DoIP_SetVehicleLogicalAddress(dword logicalAddress);
```

## Description

Sets vehicle logical DoIP address sent in DoIP PDUs.

## Parameters

* **logicalAddress**: Address used (0x0000 to 0xFFFF)

## Return Values

—

## Example

The following example sets the Logical Address of a vehicle (used e.g. in Routing Activation Responses) and makes it known to the DoIP layer.

```plaintext
dword gGatewayLogAddress = 0x1000;
write("Logical address of vehicle = 0x%04x", gGatewayLogAddress);
DoIP_SetVehicleLogicalAddress( gGatewayLogAddress);
DoIP_AddECU( gGatewayLogAddress);
```
