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

# CAPLfunctionSCCSetChargingProfileDataDynamically

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

## SCC\_SetChargingProfileDataDynamically

**CAPL Functions** » **Smart Charging** » **SCC Modeling Libraries (Simulation Setup)** » **V2G Simulation Data (write)** » **EV Functions** » SCC\_SetChargingProfileDataDynamically

**Valid for**: CANoe DE • CANoe4SW DE

### Function Syntax

```plaintext theme={null}
long SCC_SetChargingProfileDataDynamically(byte SessionID[], long SelectedTupleID);
```

### Description

This function allows to dynamically create a ChargingProfile matching the SASchedule previously received from an EVSE. The profile will be added to the created message automatically.

### Parameters

* **SessionID**: The SessionID of the ChargeParameterDiscovery.Res message that provides the SAScheduleList from which the ChargingProfile is to be derived.
* **SelectedTupleID**: Tuple that should be used as a basis for the created ChargingProfile.

### Return Values

* **0**: error
* **1**: success

### Example

```plaintext theme={null}
// create a PowerDeliveryReq message
SCC_CreatePowerDeliveryReqAC_ISO( SessionId, "Start", 1);
// create a ChargingProfile matching the SAScheduleTuple with ID 1
SCC_SetChargingProfileDataDynamically(SessionId, 1);
// send the modified message
SCC_SendPreparedMessage();
```
