Skip to main content

diagInitialize

Valid for: CANoe DE

Function Syntax

long diagInitialize(diagResponse object, char serviceQualifier[]); // form 1
long diagInitialize(diagResponse object, char serviceQualifier[], char primitiveQualifier[]); // form 2
long diagInitialize(diagRequest object, char serviceQualifier[]); // form 3
long DiagInitialize(diagRequest object); // form 4
long DiagInitialize(diagResponse object); // form 5

Method Syntax

diagResponse::Initialize(char serviceQualifier[]);
diagResponse::Initialize(char serviceQualifier[], char primitiveQualifier[]);
diagRequest::Initialize(char serviceQualifier[]);

Description

Reinitializes the object for the given service or primitive. Diagnostics request will be initialized with the default request parameters of the service, while diagnostic responses will be initialized with the default parameters of the first or specified primitive of the service. If the service is not defined, or the primitive is not defined at the given service, nothing happens and an error code is returned. Note:

Parameters

  • object: Diagnostics object to re-initialize
  • serviceQualifier: Qualifier of the service that should be used for reinterpretation
  • primitiveQualifier: Qualifier of the service primitive that should be used for reinterpretation

Return Values

Example

In an ECU simulation, initialize a response object with a specific primitive before sending it.
on diagRequest Servi 
{
    diagResponse this response; // will be initialized with first primitive 
    response.Initialize( "Servi", "ServiEcu1PR"); // Force initialization with specific primitive 
    response.SetParameter( "Voltage", 28.0); // Access primitive specific parameter 
    response.SendResponse();
}