Quickstart Guide
VDS Library
Version 1.0
English
Imprint
Vector Informatik GmbH
Ingersheimer Strae 24
D-70499 Stuttgart
The information and data given in this user manual can be changed without prior notice. No part of this manual may be reproduced in
any form or by any means without the written permission of the publisher, regardless of which method or which instruments, electronic
or mechanical, are used. All technical information, drafts, etc. are liable to law of copyright protection.
Copyright 2009, Vector Informatik GmbH
All rights reserved.
80351
Quickstart Guide VDS Library
Introduction
Table of contents
1
Introduction
1.1
About this user manual
1.1.1
Access helps and conventions
1.1.2
Certification
1.1.3
Warranty
1.1.4
Support
1.1.5
Registered trademarks
4
4
5
5
5
5
Overview
2.1
General
2.2
Goal
2.3
Benefits
Quick tour
3.1
Introduction
10
3.2
Including Vector.Diagnostics
10
3.3
Retrieve the target ECU
10
3.4
Create a Request object
10
3.5
Synchronous sending of a request and receiving responses
11
3.6
Evaluate the result of the sending
11
3.7
Access parameters in a request or response
11
3.8
Getting and setting values of diagnostic parameters
12
3.9
Handling parameter iterations
12
3.10
Handling multiplexer parameters
13
3.11
Disposing Object Resources
14
3.12
Error handling
14
3.13
Control of Tester Present request sending
15
3.14
Suppress sending of positive response
15
Rules for application independent scripts
17
4.1
Introduction
18
4.2
Restrictions
18
4.3
Reuse scripts by modularization
18
Example script
19
5.1
Introduction
20
5.2
Complete script source code (C#)
20
5.3
Using the script
5.3.1
CANape
5.3.2
CANoe
5.3.3
Indigo
25
25
25
25
Frequently asked questions: tips and tricks
27
Vector Informatik GmbH
Version 1.0
-I-
Table of contents
6.1
- II -
Introduction
FAQ Overview
28
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Introduction
1 Introduction
In this chapter you find the following information:
1.1
About this user manual
Access helps and conventions
Certification
Warranty
Support
Registered trademarks
Vector Informatik GmbH
page 4
Version 1.0
-3-
Introduction
1.1
Quickstart Guide VDS Library
About this user manual
1.1.1 Access helps and conventions
To find information
quickly
The user manual provides you the following access helps:
At the beginning of each chapter you will find a summary of the contents,
In the header you can see in which chapter and paragraph you are ((situated)),
In the footer you can see to which version the user manual replies,
At the end of the user manual you will find an index, with whose help you will
quickly find information.
Conventions
In the two following charts you will find the conventions used in the user manual
regarding utilized spellings and symbols.
Style
Utilization
bold
Blocks, surface elements, window- and dialog names of the
software. Accentuation of warnings and advices.
[OK]
Push buttons in brackets
File | Save
Notation for menus and menu entries
CANoe
Legally protected proper names and side notes.
Source code
File name and source code.
Hyperlink
Hyperlinks and references.
<STRG>+<S>
Notation for shortcuts.
Symbol
Utilization
Here you can obtain supplemental information.
This symbol calls your attention to warnings.
Here you can find additional information.
Here is an example that has been prepared for you.
Step-by-step instructions provide assistance at these points.
Instructions on editing files are found at these points.
This symbol warns you not to edit the specified file.
-4-
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Introduction
1.1.2 Certification
Certified Quality
Vector Informatik GmbH has ISO 9001:2000 certification. The ISO standard is a
Management System globally recognized standard from the British Standards Institution.
1.1.3 Warranty
Restriction of
warranty
We reserve the right to change the contents of the documentation and the software
without notice. Vector Informatik GmbH assumes no liability for correct contents or
damages which are resulted from the usage of the user manual. We are grateful for
references to mistakes or for suggestions for improvement to be able to offer you
even more efficient products in the future.
1.1.4 Support
You need support?
You can get through to our hotline at the phone numbers
+49-711-80670-200 (Germany)
+1-248-449-9290 (USA)
+1-800-457-5652 (USA)
or you write an email to the <
[email protected]>
1.1.5 Registered trademarks
Registered
trademarks
All trademarks mentioned in this user manual and if necessary third party registered
are absolutely subject to the conditions of each valid label right and the rights of
particular registered proprietor. All trademarks, trade names or company names are
or can be trademarks or registered trademarks of their particular proprietors. All rights
which are not expressly allowed, are reserved. If an explicit label of trademarks,
which are used in this user manual, fails, should not mean that a name is free of third
party rights.
Windows, Windows Vista, Windows XP, Windows 2000 are trademarks of the
Microsoft Corporation.
Vector Informatik GmbH
Version 1.0
-5-
Quickstart Guide VDS Library
Overview
2 Overview
This chapter contains the following information:
2.1
General
page 8
2.2
Goal
page 8
2.3
Benefits
page 8
Vector Informatik GmbH
Version 1.0
-7-
Overview
2.1
Quickstart Guide VDS Library
General
API documentation: The detailed API documentation is provided in the online-help
format at Vector.Diagnostics.chm in the installation directory.
2.2
Goal
Main Goals
The VDS Library (Vector Diagnostic Scripting Library) provides a way to
Automate the execution of diagnostic sequences
Create, configure and send diagnostic request
Receive and interpret diagnostic responses
Share diagnostic procedures between CANoe, CANape, CANdito and Indigo
(starting with CANoe 7.1. SP3, CANape 8.0, CANdito 4.0, Indigo 1.0 SP2)
2.3
Benefits
.NET library
Basing the library on .NET provides the following benefits:
Any .NET programming environment may be used
Full development support is provided
Any .NET language may be used
Concept
The API was designed with these targets in mind:
Easy usage
Focus on application of diagnostic
Simple creation of small scripts AND potential to build complex applications
Usage of standard .NET classes and self-made libraries is possible
Reuse
-8-
Scripts may be developed with one tester application (e.g. CANoe) and reused in
every other application (e.g. Indigo, CANape). Please refer to section 4 for details.
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Quick tour
3 Quick tour
In this chapter you find the following information:
3.1
Introduction
page 10
3.2
Including Vector.Diagnostics
page 10
3.3
Retrieve the target ECU
page 10
3.4
Create a Request object
page 10
3.5
Synchronous sending of a request and receiving responses
page 11
3.6
Evaluate the result of the sending
page 11
3.7
Access parameters in a request or response
page 11
3.8
Getting and setting values of diagnostic parameters
page 12
3.9
Handling parameter iterations
page 12
3.10 Handling multiplexer parameters
page 13
3.11 Disposing Object Resources
page 14
3.12 Error handling
page 14
3.13 Control of Tester Present request sending
page 15
3.14 Suppress sending of positive response
page 15
Vector Informatik GmbH
Version 1.0
-9-
Quick tour
3.1
Introduction
Function set at a
glance
3.2
Quickstart Guide VDS Library
This section introduces the content of the library with small snippets of C# code. It is
not a complete API description please refer to the provided online help file for that.
Including Vector.Diagnostics
Concept
In order to use Vector Diagnostic Scripting, it is necessary to import the library into
the .NET module.
// Import library definitions
using Vector.Diagnostics;
Recommendation
In complex applications it can be beneficial to use an alias for the namespace to
prevent name collisions and make the source of a class more obvious.
// Import library definitions and assign an alias
using Diag = Vector.Diagnostics;
// To access the declarations the alias has to be put in front
Diag.Ecu ecuEngine = Diag.Application.GetEcu("Engine");
3.3
Concept
Retrieve the target ECU
In order to communicate with an ECU, a script must retrieve an ECU object from the
application. Only diagnostic descriptions configured at the application may serve as
target.
// Retrieve the ECU with the identifier "Engine"
Ecu ecuEngine = Application.GetEcu("Engine");
3.4
Concept
Create a Request object
At the ECU object, requests may be created using the qualifier of a diagnostic service
defined in the diagnostic description, or by providing a valid PDU as byte array.
// Create a request using the service qualifier
Request reqReadSWV =
ecuEngine.CreateRequest("Software_Version_Read");
// Create a request using a (valid) PDU
Request reqRaw =
ecuEngine.CreateRequest(new byte[] { 0x10, 0x03 } );
- 10 -
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
3.5
Concept
Quick tour
Synchronous sending of a request and receiving responses
A request is always in a state that allows sending it on the network configured in the
application for its diagnostic description. The synchronous call waits until the request
is processed completely, i.e. either all expected responses have to be received, or a
timeout or an error has to occur.
// Send request on the network and wait for responses/timeout
SendResult result = request.Send();
3.6
Concept
Evaluate the result of the sending
The send result value indicates whether sending the request succeeded, the
responses received for the request, and if the response could be processed.
if (result.Status == SendStatus.CommunicationError)
{
// Handle communication error
}
else if (result.Status == SendStatus.Ok)
{
if (result.Response != null)
{
// Process response object
Response response = result.Response;
}
}
Note
3.7
Concept
For diagnostic services that may receive several responses (e.g. functional requests
or certain fault memory requests), the property Responses is used to provide a list of
response objects.
Access parameters in a request or response
You can retrieve a parameter at its parent object via its qualifier.
If a parameter cannot be found, null is returned. It is the responsibility of the
diagnostic script to check the return value.
// Retrieve the parameter from the request with its qualifier
Parameter param1 = request.GetParameter("EngineSpeed");
if (param1 == null)
{
// Error: parameter could not be found
}
Vector Informatik GmbH
Version 1.0
- 11 -
Quick tour
Parameter hierarchy
Quickstart Guide VDS Library
A parameter can hold child parameters that are accessible using the Parameters
property. Either the qualifier of the sub-parameter may be used, or its index.
// Get the sub-parameter using its qualifier
Parameter subParam1 = param1.Parameters["MySubParam1"];
if (subParam1 != null)
{
// Get the second parameter from the sub-parameter list
Parameter subParam2 = param1.Parameters[1];
}
3.8
Concept
Getting and setting values of diagnostic parameters
Parameters in message objects are initialized with the default values defined in the
diagnostic description (when requests are created using a service qualifier), or by a
PDU as raw byte array (e.g. response messages received from the ECU).
Each parameter object has methods that give access to its value in different formats:
a numeric parameter can be retrieved as double value or as formatted string, e.g.
double valueNumeric = param1.Value.ToDouble();
string valueSymbolic = param1.Value.ToString();
You can also set the value of a (request) parameter by calling the appropriate
method.
If setting the parameter is not possible, false is returned by the methods. It is the
responsibility of the diagnostic script to check the return value.
// Try to set the parameter to a numeric value
if (!param1.Value.Set(27.3))
{
// Could not set the parameter to the given value!
}
// Try to set the parameter to a symbolic value
if (param1.Value.Set("red"))
{
// Setting the text table value succeeded
}
3.9
Concept
Handling parameter iterations
Diagnostic services model lists of parameters using iterations. The number of iteration
elements depends on its definition, e.g. an end-of-data iteration will fill up the
complete message, while an end-marker iteration uses a specific value to indicate its
end.
The scripting library allows direct access to the iteration and its elements at the
parameter that represents it.
- 12 -
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Quick tour
// Get the list of DTCs in the response object
Parameter iterParam = response.Parameters["ListOfDTCs"];
if (iterParam != null)
{
// The list of DTCs is available
if (iterParam.Parameters.Count > 0)
{
// Since the list is not empty, get the first DTC
Parameter dtc = iterParam.Parameters[0].Parameters["DTC"];
}
}
Iterations in requests For a request parameter, it is possible to set the number of iterations by calling a
function. False is returned if this is not possible.
// Get the parameter that represents a list
Parameter iterParam = request.Parameters["ValueList"];
if (iterParam != null)
{
// Modify the number of iteration elements
if (iterParam.SetIterationCount(4))
{
// Set the value in the last iteration
iterParam.Parameters[3].Value.Set(27);
}
}
3.10 Handling multiplexer parameters
Concept
There is a special case where the value of one parameter determines the structure of
one or more other parameters. For example, the selector parameter choses between
several parameter structures that becomes active depending on its value.
If a selector parameter is set, the parameter structure of the request may change
fundamentally, causing parameters retrieved earlier to become invalid. Therefore
great caution has to be taken in this case; otherwise null parameters may be used.
// Get the multiplexer parameter and check its first parameter
Parameter mux = request.GetParameter("MUX");
Parameter firstParamInMux = mux.Parameters[0];
if (firstParamInMux.Qualifier == "Struct1_P1")
{
// ...
}
// Get the selector parameter and change its value
Parameter selector = request.GetParameter("Selection");
selector.Value.Set(27);
Vector Informatik GmbH
Version 1.0
- 13 -
Quick tour
Quickstart Guide VDS Library
// firstParamInMux is no longer valid!
if (mux.Parameters[0].Qualifier == "Struct27_P1")
{
// The first parameter in the multiplexer is different now!
}
3.11 Disposing Object Resources
Concept
The resources that are held for messages (requests and responses) have to be
cleared after the according objects wont be accessed any more. This has to be done
by calling the Dispose() method of such objects.
To assure that all (of the possibly multiple) responses of a service communication
transaction are cleared, call the Dispose() method of the SendResult object.
Request request = ecuEngine.CreateRequest("...");
SendResult sendResult = request.Send();
// Perform actions on response
sendResult.Dispose(); // Free allocated response resources
request.Dispose(); // Free allocated request resources
Recommendation
As it is a common operation for managed languages (like C#) to explicitely dispose
object resources, C# comes with an extra statement: which is built-in in the language:
using.
With this keyword one can define a scope, outside of which an object will
automatically be disposed.
using (Request request = ecuEngine.CreateRequest("..."))
{
using (SendResult sendResult = request.Send())
{
// Perform actions on response
} // Implicitely calls sendResult.Dispose()
} // Implicitely calls request.Dispose()
3.12 Error handling
Concept
Error handling is performed according to these rules:
Return values are used wherever possible to indicate whether calling a method
succeeded.
Exceptions are only used when it is necessary to indicate a fundamental problem
and the application cannot continue executing the script.
Return values
- 14 -
Methods return true or false to indicate success or failure. If objects are returned, null
indicates failure. The method Request.Send returns a more elaborate SendResult
object that indicates the reason for failure in more detail.
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Quick tour
3.13 Control of Tester Present request sending
Concept
It is possible to control the sending of Tester Present requests explicitly to keep the
ECU in a specific diagnostic session, or let it drop to the default session after the
sending has been deactivated.
// Toggle the sending of tester present requests
if (ecuEngine.IsTesterPresentActive())
ecuEngine.ActivateTesterPresent(false);
else
ecuEngine.ActivateTesterPresent(true);
3.14 Suppress sending of positive response
Concept
The UDS protocol defines the possibility to instruct the ECU to suppress the sending
of a positive response message. A flag has to be set in the request to activate this
feature.
// Set the flag to tell the ECU to not send a positive response
request.SuppressPositiveResponse = true;
SendResult result = request.Send();
// Does not expect a response
Vector Informatik GmbH
Version 1.0
- 15 -
Quickstart Guide VDS Library
Rules for application independent scripts
4 Rules for application independent scripts
In this chapter you find the following information:
4.1
Introduction
page 18
4.2
Restrictions
page 18
4.3
Reuse scripts by modularization
page 18
Vector Informatik GmbH
Version 1.0
- 17 -
Rules for application independent scripts
4.1
Quickstart Guide VDS Library
Introduction
Background
The applications providing the VDS library have different concepts, e.g.:
CANoe executes the scripts in a real-time context that allows no GUI elements,
especially for automated ECU testing.
CANape focuses on the calibration of ECUs.
Indigo is a pure diagnostic tester that offers a use-case-driven GUI to apply
diagnostics.
Consequence
4.2
The applications offer very different use case libraries that cannot be present in every
tool, therefore great care has to be taken to use only common functionality in
diagnostic scripts intended to be portable.
Restrictions
Allowed libraries
Only libraries and methods that follow these restrictions may be used in portable
scripts:
No parts of the threading API may be used.
No GUI operations may be used.
Real-time processing must not be disturbed, i.e. blocking calls (e.g. for network or
I/O operations, or complex XML parsing) have to be avoided.
Garbage collection of long duration should be avoided.
No Assemblies
4.3
Hint
The scripts can only be exchanged as source code files. Compiles assemblies are not
supported for portable scripts.
Reuse scripts by modularization
A practical way to reuse diagnostic scripts is modularization:
Create one module containing only the diagnostic scripts.
Create application specific modules that import the diagnostic scripts module, and
use the application specific features (e.g. test report generation in CANoe) only in
those modules.
- 18 -
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Example script
5 Example script
In this chapter you find the following information:
5.1
Introduction
page 20
5.2
Complete script source code (C#)
page 20
5.3
Using the script
page 25
Vector Informatik GmbH
Version 1.0
- 19 -
Example script
5.1
Quickstart Guide VDS Library
Introduction
Introduction
The following C# script will bring an ECU in the extended session, unlock it using the
seed and key algorithm, and retrieve and print the variant coding values.
Info: Please have a look at the following sections for instructions on using the script
in the Vector applications.
5.2
Complete script source code (C#)
Initialization
Import the libraries needed in this script
using Diag = Vector.Diagnostics;
using Vector.Tools;
Public class
// diagnostic functionality
// output functions
Define a public class with default constructor to allow creation of an object of this type
without additional information.
public class CodingReader
{
Tool function
The following function tries to create a request for the given ECU, and checks if this is
possible. An error is printed to the write window and null is returned if it fails.
private Diag.Request CreateRequestWithCheck(Diag.Ecu ecu,
string serviceQualifier)
{
Diag.Request req = ecu.CreateRequest(serviceQualifier);
if (req == null)
{
Output.WriteLine(
"Error: Cannot create request for service "
+ serviceQualifier);
}
return req;
}
Tool function
This function sends a request and waits for the response. If the request cannot be
sent or no response is received, null is returned, the received response otherwise.
private Diag.Response SendRequestWithCheck(
Diag.Request request)
{
// If no request is given return immediately
if (request == null)
return null;
// Send the request and wait for the response
Diag.SendResult result = request.Send();
- 20 -
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Example script
// Evaluate the result of the operation
if (result.Status != Diag.SendStatus.Ok)
{
Output.WriteLine("Error: SendStatus = "
+ result.Status.ToString());
}
// (Notice that this example assumes and requires that
// the ECU returns only one response!)
return result.Response;
}
Script function
A script function is any public method of the public class that does not expect
arguments and returns void.
// Read the variant coding settings from the ECU
// The ECU has to be unlocked before the service may be
// executed, which can be done in the extended session only
public void ReadVariantCoding()
{
Access the ECU
Communication with an ECU can only be performed after the object representing it is
retrieved from the application.
// Retrieve the ECU to communicate with
Diag.Ecu door = Diag.Application.GetEcu("Door");
if (door == null)
{
Output.WriteLine("Error: Cannot access 'Door'!");
return;
}
Extended session
The unlock algorithm may only be started in the extended diagnostic session,
therefore the ECU is switched into this session. Since the positive response is of no
interest here, the suppress positive response flag is set at the request.
// Enter the extended session, but do not expect a positive
// response
using (Diag.Request reqStart = CreateRequestWithCheck(door,
"ExtendedDiagnosticSession_Start"))
{
if (reqStart != null)
reqStart.SuppressPositiveResponse = true;
using (Diag.Response respStart =
SendRequestWithCheck(reqStart))
{
Vector Informatik GmbH
Version 1.0
- 21 -
Example script
Session change
failure
Quickstart Guide VDS Library
If the ECU sends a negative response, it is likely that it is in a non-default session
already, so only a warning is printed and the script continues.
// Check if the ECU sent a negative response
if (respStart != null && ! respStart.IsPositive)
{
Output.WriteLine(
"Warning: negative response received!");
}
}
}
Request seed value
For the seed and key algorithm, the seed has to be requested from the ECU first. If
this fails, the script cannot continue and will abort with an error.
// Request the seed for the unlocking procedure
using (Diag.Request reqSeed = CreateRequestWithCheck(door,
"SeedLevel1_Request"))
{
using (Diag.Response respSeed =
SendRequestWithCheck(reqSeed))
{
if (respSeed == null || ! respSeed.IsPositive)
{
Output.WriteLine(
"Error: no or negative response received for request seed!
Aborting.");
return;
}
Get parameters for
seed and key
The parameter representing the seed is retrieved from the response, and the
parameter that holds the key is retrieved from a new request. If any of these
parameters is not accessible, the script must abort with an error.
// Retrieve seed and key parameters
Diag.Parameter seedParam =
respSeed.GetParameter("SecuritySeed");
using (Diag.Request reqKey =
CreateRequestWithCheck(door, "KeyLevel1_Send"))
{
Diag.Parameter keyParam =
reqKey.GetParameter("SecurityKey");
if (seedParam == null || keyParam == null)
{
Output.WriteLine(
"Error: Seed or key parameter not accessible!");
return;
}
- 22 -
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
Compute key value
Example script
The sample ECU uses a trivial algorithm to compute the key value from the seed
value. It is set at the key parameter immediately for sending it in the request.
// The sample ECU uses a trivial algorithm to compute
// the key that can be coded easily
keyParam.Value.Set(
0xFFFF - (seedParam.Value.ToUInt32() & 0xFFFF));
Send key
The request containing the computed key value is sent to the ECU. The response
must be positive to indicate that the ECU has been unlocked successfully. Otherwise
the script aborts with an error.
// Send the key to the ECU and check if a positive
// response was received
using (Diag.Response respKey =
SendRequestWithCheck(reqKey)
{
if (respKey == null || ! respKey.IsPositive)
{
Output.WriteLine("Error: Unlocking ECU failed!");
return;
}
}
}
}
}
Retrieve coding
information
Once the ECU is unlocked, the coding information can be retrieved by sending the
appropriate request.
// Request the coding information from the ECU
using (Diag.Request request = CreateRequestWithCheck(door,
"Coding_Read"))
{
using (Diag.Response response =
SendRequestWithCheck(request))
{
if (response == null || !response.IsPositive)
{
Output.WriteLine(
"Error: Could not retrieve coding!");
return;
}
Vector Informatik GmbH
Version 1.0
- 23 -
Example script
Output information
Quickstart Guide VDS Library
The parameters representing the variant coding information is output as text. Since a
structure is used, the structure parameter is retrieved first, and the actual information
is located in parameters that are children of the structure parameter.
// Output the information about the coding
Diag.Parameter codingStructure =
response.GetParameter("Codingstring");
Output.WriteLine(
"The ECU 'Door' is coded for '" +
codingStructure.Parameters["Codingstring.CountryType"]
.Value.ToString() +
"' as a '" +
codingStructure.Parameters["Codingstring.VehicleType"]
.Value.ToString() +
"' with special value " +
codingStructure.Parameters[
"Codingstring.SpecialAdjustment"].Value.ToString()
+ ".");
}
}
Return to default
session
In a final step, the ECU is put into the default session, locking it again.
// Return the ECU to default session
using (Diag.Request request = CreateRequestWithCheck(door,
"DefaultSession_Start"))
{
using (Diag.Response response =
SendRequestWithCheck(request))
{
if (response == null || ! response.IsPositive)
{
Output.WriteLine(
"Error: no or negative response received! ");
}
}
}
}
}
- 24 -
Version 1.0
Vector Informatik GmbH
Quickstart Guide VDS Library
5.3
Example script
Using the script
5.3.1 CANape
Introduction
The script can be loaded into the "UDS demo delivered with every CANape
installation.
Configuration
Open the "Tools -> Task manager menu dialog and go to the .Net Scripts tab.
Press the Insert button and add the according file (e.g. named CodingReader.cs)
containing the script.
Then select the according method (e.g. "CodingReader::ReadVariantCoding) and
press the Select button.
Execution
Within the Task Manager window this method now can be started using the Start
button.
5.3.2 CANoe
Introduction
The script can be loaded into the "UDSsim demo delivered with every CANoe
installation.
Configuration
Open the "Macro and .NET Snippet Configuration dialog (Configuration|Macro)
and "Add the file (e.g. named CodingReader.cs) containing the script. After
compilation, the .NET snippet "CodingReader::ReadVariantCoding is available.
Execution
From the toolbar "Macro / Snippet, the snippet can be selected and started while the
measurement is running.
5.3.3 Indigo
Introduction
The script can be loaded into the Indigo demo available e.g. via the Startup tab.
Configuration
Open the "Script Manager window (View|ScriptManager or toolbar button <Script
Manager>) and load the script with "Import Script . The script named
CodingReader.cs is located in the <Examples> folder of the Indigo installation folder.
Execution
The script can be executed via the Script Runner window (View|ScriptRunner or
toolbar button <Script Runner>).
Vector Informatik GmbH
Version 1.0
- 25 -
Quickstart Guide VDS Library
Frequently asked questions: tips and tricks
6 Frequently asked questions: tips and tricks
In this chapter you find the following information:
6.1
FAQ Overview
Vector Informatik GmbH
page 28
Version 1.0
- 27 -
Frequently asked questions: tips and tricks
6.1
Quickstart Guide VDS Library
FAQ Overview
Introduction
The following list is a collection of hints to make development of diagnostic scripts
easier.
FAQ: Where do I find the qualifiers of services and parameters?
Answer
There are several ways to access the qualifiers:
In CANdelaStudio (the View version is provided with every
CANape/CANoe/Indigo, e.g.) you can open a CANdela diagnostic description and
see the qualifier at the properties dialog of every object.
The Effective ODX Viewer (also provided with CANape/CANoe/Indigo) displays
the content of ODX files and allows access to the short names that function as
qualifiers.
The diagnostic console window (provided in CANoe, CANape and CANdito) can
be configured to display the qualifiers of diagnostic services and parameters.
The CANape Diagnostic Object Selection dialog (available in the Diagnostic
objects context menu of the Function Editor) provides easy access to all those
qualifiers.
The CANoe CAPL browser allows inserting service and parameter qualifiers into
CAPL programs. You can open an empty CAPL program from CANoe and copy
the output of the symbolic selection dialog (opens after pressing the right mouse
button in an edit region) into your program.
The Indigo "Script Manager window allows the generation of sample code for all
services of selected ECUs. This sample code can be used for copy/paste of the
services and the associated parameters.
The Diagnostic Console window in Indigo allows to record scripts. Use the
Record button in the toolbar to start recording. To finish recording press the
Record button again and enter the filename.
FAQ: Is there a simple way to perform operations on every element of a parameter
list or iteration?
Answer
A comfortable way to perform actions on every element of a parameter list or iteration
is the standard C# foreach construct:
// Print the qualifiers of all child parameter
foreach (Parameter param in parentParam.Parameters)
{
Output.WriteLine(param.Qualifier);
}
- 28 -
Version 1.0
Vector Informatik GmbH
Get more Information!
Visit our Website for:
> News
> Products
> Demo Software
> Support
> Training Classes
> Addresses
www.vector-worldwide.com