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

# CAPLfunctionDiagvFlashTestWaitForvFlashLastErrorMessage

# TestWaitForvFlashLastErrorMessage

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

**Note**\
With the following function(s) a CAPL program can use [vFlash](../../../CANoeCANalyzer/VTPPlatformManager/CANoePlugIN/CANoePlugInvFlashCompact.md) to program an ECU. vFlash has to be installed on the system running the RT kernel.\
See also: [vFlash Automation (Sample Configuration)](../../../SampConf/Programming/CANoe/vFlashAutomation/vFLASHsampCN.md).

## Function Syntax

`long TestWaitForvFlashLastErrorMessage(char errorText[], dword maxLength);`

## Description

Waits until the last detailed error message is retrieved from vFlash. If a message is received, it is copied into the given buffer.

## Parameters

—

## Return Values

* **1**: Success
* other: please refer to `enum vFlashStatusCode` in `Reusable\CAPL_Includes\vFlash\Utilities.cin`

## Example

—

[TestWaitForvFlashReprogrammed](CAPLfunctionDiagvFlashTestWaitForvFlashReprogrammed.md)
