Ediabas API Guide
Ediabas API Guide
1. Revision history
2. Introduction
3. General Information
B. REFERENCES
1. Revision history
Version 3.0 First release
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 2 of 106
2. Introduction
More:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 3 of 106
2.4. Trademarks
EDIABAS API Developer's Guide > API User Manual > 2. Introduction
This manual describes how application, programs can be created and maintained with access to the
Electronic Diagnostic Basic System (EDIABAS). It describes the use of the tools and the various
options available. A general description of the interface is contained in [3]. A detailed description
of all API functions can be found in [4]. General information about EDIABAS and about the ECU
(Electronic Control Unit) description files (SGBDs) is described in [2].
EDIABAS API Developer's Guide > API User Manual > 2. Introduction
Example Description
SAMPLE.C Uppercase denotes file names and operating system
commands.
apiJob, Bold-faced type identifies keywords and operators of the
APIREADY language C/C++ as well as API functions and definitions
.}
[1] Reference to a document in References.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 4 of 106
EDIABAS API Developer's Guide > API User Manual > 2. Introduction
An explanation of all the abbreviations used in this and all other EDIABAS documentation can be
found in the publication "EDIABAS User Manual", chapter "GLOSSARY".
EDIABAS API Developer's Guide > API User Manual > 2. Introduction
2.4. Trademarks
Microsoft, MS, MS-DOS, Windows, Windows Vista, WIN32, WIN64, Pocket PC, Visual C++ and
Visual Basic are registered trademarks of Microsoft Corporation.
SCO, SCO UNIX and OpenServer are registered trademarks of Santa Cruz Operation, Inc.
3. General Information
The API (Application Programming Interface) programming interface of EDIABAS can be seen by
the application program as a collection of functions, the API functions. ANSI C is used as the
programming language .
Ready-to-use API libraries are available from Softing for the EDIABAS target system. These
libraries must be included in the application programs.
All files necessary for creating application programs with access to EDIABAS are supplied on the
diskette APPLICATION DEVELOPMENT KIT.
More:
EDIABAS API Developer's Guide > API User Manual > 3. General Information
In order to call an API function in an application program, the C/C++ compiler requires the
prototypes of the corresponding API function. The prototypes of all API functions are contained in
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 5 of 106
INCLUDE file API.H. In addition to the prototypes, the INCLUDE file contains all constants and
type definitions which EDIABAS uses and which are required by the application program.
#include "api.h"
extern "C" {
#include "api.h"
These instructions are to be specified in every C/C++ source file of the application program in
which API functions are called or constants (or type definitions) are required from API.H are
required.
The API.H search path is to be specified so that the C/C++ compiler can find the INCLUDE file.
The corresponding compiler option is compiler dependent and can be found in the description of
the compiler being used.
EDIABAS API Developer's Guide > API User Manual > 3. General Information
All API functions of a target system are contained in a library. This library is to be specified to the
linker during linking for inclusion of the files. This is linker-dependent and usually accomplished in
a MAKE file.
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
SOFTING supports the following development environments for creating application programs
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 6 of 106
More:
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.1. WIN32 Application Programs
In addition to the project-specific compiler options, the compiler is to be called with the following
options for every source file having access to API functions:
/I<path of api.h>
The API library API32.LIB for Visual C++ 2010/2008 resides in EDIABAS directory API\WIN32
\VC2010 / API\WIN32\VC2008.
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.1. WIN32 Application Programs
In addition to the project-specific compiler options, the compiler is to be called with the following
options for every source file having access to API functions:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 7 of 106
/I<path of api.h>
Visual C++ 6.0 is supported for single- und multi-thread-mode. The API libraries APIW32.LIB
(single-thread) and APIW32MT.LIB (multi-thread) resides in EDIABAS directory API\WIN32
\VC6.
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.1. WIN32 Application Programs
The corresponding application program can access EDIABAS by adding the module API.BAS in a
Visual Basic project.
and offers an API interface limited in functional scope. The APIVB32.DLL (WIN32) contained in
the RUNTIME SYSTEM is required at runtime for accessing EDIABAS.
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.1. WIN32 Application Programs
For the .NET Frameworks 1.x/2.0/3.5/4.0 access to EDIABAS is possible under Win32. To permit
this the framework-spezific .NET files apiNET32.DLL/apivbNET32.DLL must exist in the
application program directory. The EDIABAS program directory must be available over the system
search path.
The Assembly apiNET32.dll is the API interface for .NET applications under Win32. It handles the
access to the DLL interface of api32.dll. Since api32.dll doesn’t support the functions
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 8 of 106
Additionally to the program code the Assembly apiNET32.dll all necessary API-
deklarations/definitions.
The Assembly apivbNET32.dll handles Visual Basic.NET specific features and translates them into
equivalent calls of the Assembly apiNET32.dll. The associated Basic-Modul API.VB imports the
Assembly apiNET32.dll and hides the via apivbNET32.dll necessary special handling for Visual
Basic.NET. All API access must be done using the class API defined in API.VB. The import of the
Assembly apiNET32.dll/apivbNET32.dll is already done in API.VB and needn’t be done in the
source files of the application.
The following steps are necessary on the developer’s PC with Visual C#.NET in .NET projects
with API access:
All API access must be done using the class Ediabas.API. If the name space Ediabas is defined by
the using command, only the class name API has to be given.
using System;
using Ediabas;
//…
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 9 of 106
The following steps are necessary on the developer’s PC with Visual Basic.NET in .NET projects
with API access:
The Basic module API.VB imports the Assembly apiNET32.dll and hides the via apivbNET32.dll
necessary special handling for Visual Basic.NET.
All API access must be done using the class API defined in API.VB. The import of the Assembly
apiNET32.dll/apivbNET32.dll is already done in API.VB and needn’t be done in the source files of
the application.
Example for a Visual Basic.NET source file (using the API.VB class):
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 10 of 106
'…
End If
Under Visual Basic 2005/2008/2010 the CLS compliance has to be deactivated/commented out in
the application (AssemblyInfo.vb):
'<Assembly: CLSCompliant(True)>
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.1. WIN32 Application Programs
EDIABAS can also be accessed directly via the DLL interface from API32.DLL with every
development tool suitable for this purpose. The DLL interface, however, does not offer the
complete scope of functions for the API interface.
The C functional declarations of the DLL interface are contained in INCLUDE file APIDLL.H.
File APICALLS.C contains the source code of the libraries APIW32.LIB/API32.LIB, in which the
complete API functionality is also available under other C/C++ development tools.
Files APIDLL.H and APICALLS.C are contained in the EDIABAS directory API\WIN32.
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.2 WIN64 Application Programs
In addition to the project-specific compiler options, the compiler is to be called with the following
options for every source file having access to API functions:
/I<path of api.h>
The API library API64.LIB for Visual C++ 2010/2008 resides in EDIABAS directory API\WIN64
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 11 of 106
\VC2010 / API\WIN64\VC2008.
EDIABAS API Developer's Guide > API User Manual > 4. Using the INCLUDE File and Library
> 4.2 WIN64 Application Programs
EDIABAS can also be accessed directly via the DLL interface from API64.DLL with every
development tool suitable for this purpose. The DLL interface, however, does not offer the
complete scope of functions for the API interface.
The C functional declarations of the DLL interface are contained in INCLUDE file APIDLL.H.
File APICALLS.C contains the source code of the libraries API64.LIB, in which the complete API
functionality is also available under other C/C++ development tools.
Files APIDLL.H and APICALLS.C are contained in the EDIABAS directory API\WIN64.
• Common
• Job call
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 12 of 106
• Identifying results
B. REFERENCES
[1] EDIABAS: BEST User Manual
1. Update history
2. Introduction
3. General
5. Application example
A. List of references
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 13 of 106
1. Update history
Version 3.0 First release
Version 6 New API function apiInitExt, additional results of the virtual job _VERSIONINFO
and parallel processing with Win32
2. Introduction
More:
2.2. Conventions
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 14 of 106
EDIABAS API Developer's Guide > API Interface Description > 2. Introduction
This manual describes the use of constants and functions that are available in the EDIABAS-API
interface. Reference [3] gives a detailed description of these functions. Linking into a development
environment is described in Reference [4]. You will find general information about EDIABAS and
control unit description files in Reference [2].
EDIABAS API Developer's Guide > API Interface Description > 2. Introduction
2.2. Conventions
Example Description
SAMPLE.C Upper case characters are used for filenames, registers and
operating system commands.
apiJob, Bold type is used for key words and operators of the
APIREADY BEST/2 and BEST/1 languages and for API functions. In
syntax descriptions these words must be written as shown.
expression Italics designate placeholders for values to be entered by
the programmer; e.g., file names.
[option] Words enclosed in square brackets may be optionally
specified.
{ result | Curvy braces and vertical strokes characterize entries from
argument } which only one must be selected, except when in square
brackets.
[constant...] job... An ellipsis (three dots) which directly follows an
expression indicates that several expressions of the same
type can follow.
hallo="Test"; This syntax designates examples, user entries, program
outputs and error messages.
while() { A column or a row comprising three dots indicates that a
section of an example was intentionally omitted.
.
.}
[1] Reference to a document in References.
EDIABAS API Developer's Guide > API Interface Description > 2. Introduction
The abbreviations used in this and all other EDIABAS documents are explained in the
"GLOSSARY" section of the "EDIABAS User Manual". The term API is explained in greater
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 15 of 106
3. General
The API application interface is the EDIABAS standard program interface across which an
application program sends jobs to EDIABAS to operate control unit functions and across which the
application program receives the results of the job execution back from EDIABAS.
4.7. Configuration
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
The compatibility and version of the API can be checked by the function apiCheckVersion before
EDIABAS is accessed for the first time:
As parameter version request the minimum API version required by the application should be
passed (e.g. 0x0700 for API 7.0.x):
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 16 of 106
If compatibility shall be requested according to the current ADK, the pre-defined constant
APICOMPATIBILITYVERSION can be passed.
The function apiCheckVersion copies the current API version into the variable referenced by
version information address (max. APIMAXCONFIG characters). If version information address
has the value NULL, the reading of the version is suppressed.
The function call apiCheckVersion doesn’t influence the API error state. In case of an
incompatible or no found API no EDIABAS error will be caused.
In case of a current API-Version < 7.0.0 an incompatible API will be assumed. In that case the
function apiCheckVersion will return APIFALSE and the version information will be an empty
string.
The function apiCheckVersion can be called before the EDIABAS initialization or between
initialization and abort of EDIABAS.
The function call apiCheckVersion is optional and will not be recorded in the API trace.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
A general initialization of EDIABAS must take place before the application program can call API
functions. This is done with one of the following initialization functions:
apiInit ( )
When API is initialized with apiInit(), EDIABAS performs a system-dependent default setting for
the diagnostic interface (device), device connection and device application.
By calling apiInitExt(), it is possible to determine already during API initialization the diagnostic
interface (device) to be used, the device connection and device application. The default setting for
the diagnostic interface (device), device connection and device application can be accepted by
entering a null string.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 17 of 106
The settings performed with apiInitExt() are only effective until API is aborted (apiEnd()).
Calling apiInit() or apiInitExt() also runs the application locking procedure that is described below
in a separate section.
As a return value, the functions apiInit() and apiInitExt() provide information about the success of
the EDIABAS initializing procedure:
An API session can be terminated with the apiEnd() function, in which case the main memory and
equipment are released.
After an API session has been terminated you must initialize with apiInit() or apiInitExt() before
you can access API functions again.
Calling apiInit() or apiInitExt() without an apiEnd() will automatically initiate an apiEnd() in the
application program (if a session is not yet terminated).
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
After initializing, control units can be accessed by sending API jobs to the EDIABAS. These jobs
always have the following structure:
The argument CU group/variant establishes the link with the addressed control unit, i.e. the relevant
control unit description file (SGBD). The name of the SGBD is always given without its extension,
e.g.:
The argument job corresponds to the job name defined in the ECU description file SGBD, whereby
no differentiation is made between upper- and lowercase.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 18 of 106
Arguments parameter and Parameterdata/-length are job parameters. Only a text string in "C"
format can be passed as argument to function apiJob (e.g., "Par1;Par2;Par3" or ""). The individual
parameters are separated in the argument with a semicolon, whereby upper- and lowercase are
differentiated. apiJobData and apiJobExt can be passed as both a text string and binary data.
Additional parameters for standard jobs can be passed to function apiJobExt. These parameters are
passed to all standard jobs which are automatically executed after calling apiJobExt either before
or after the specified job. If a text string is passed as a parameter in either apiJobData or
apiJobExt, the length of the text string must be passed without the final '\0 character, otherwise the
number of data bytes must be passed. A typical application for binary parameter data is the
TRANSPARENT-MODE of EDIABAS. Further information can be found in reference [5].
The argument results determines which job events are to be produced. The individual results are
separated with a semicolon in the argument, whereby no difference is made between upper- and
lowercase. If all results are to be processed, specify a blank string for argument results. The
selective creation of certain results must have been implemented when creating the ECU
description file; otherwise all results are produces despite specification of special results.
For the function apiJob the maximum parameter length is APIMAXPARA, for the functions
apiJobData and apiJobExt it’s APIMAXPARAEXT.
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs
You communicate with an unknown control unit variant by defining the group name as the first
argument of the job:
The control unit group description file is loaded to identify the fitted variant.
After successful identification the appropriate control unit description file is loaded and the job is run.
When identifying the variant the name of the control unit group is used as a reference for the control
unit group description file, the variant name of the control units being used to allocate corresponding
control unit description files.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 19 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs
Communication with a defined control unit variant is achieved by defining the variant name as the
first argument in the job:
The name of the control unit variant is then copied to the standard result VARIANTE.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs
Standard jobs are jobs predefined by EDIABAS, their use is precisely specified and must be stored in
control unit description files.
The result of standard jobs is stored in specified standard results that are polled automatically by
EDIABAS.
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.3. Standard jobs
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 20 of 106
• for a job with a defined variant (only after changing the control unit variant)
• for a job with an unknown variant
• after a call of the BEST/2 function doNewInit in an SGBD.
The standard job INITIALISIERUNG must exist in every group and variant description file.
Successful initializing must be displayed with the standard result DONE (result type APIINTEGER
or APIWORD) in a result set:
The standard job INITIALISIERUNG must not return any results except DONE.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.3. Standard jobs
The standard job IDENTIFIKATION is called to identify the fitted control unit variant:
The standard job IDENTIFIKATION must exist in every group description file.
An identified control unit variant must be displayed with the standard result VARIANTE (string of
result type APITEXT) in a result set:
• Result VARIANTE = string (1 character min.) Identification successful, the result is the
name of the control unit variant
The standard job IDENTIFIKATION must not return any results except VARIANTE.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.3. Standard jobs
The optional standard job ENDE is called when the description file is changed:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 21 of 106
The standard job ENDE can exist in any group and variant description file.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs
Virtual jobs are jobs predefined by EDIABAS; when called they provide information about a control
unit description file.
Unlike standard jobs, virtual jobs are not in the control unit description files but are simulated by
EDIABAS. However virtual jobs can be overwritten by self-defined jobs within the control unit
description files.
The results of virtual jobs are stored in standard results with fixed names which are polled in the same
way as the results of normal jobs (see section "Identifying results").
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job _JOBS identifies the names of all the jobs in the control unit description file (but not
the names of virtual jobs).
Each job name is stored in a separate result set as a standard result JOBNAME, so the number of
result sets is the number of jobs in the control unit description file.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 22 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job _JOBCOMMENTS determines the comment to a particular job. The name of the
job to be investigated is to be specified as job parameter when calling the virtual job. Determining
the results is only possible with BEST2 ECU description files, which was not subsequently
processed using the tool STRIP.
The following information are stored in the first result set for each result.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job _VERSIONINFO determines general information about the ECU description file
and stores this in the first result set:
The following additional information is determined for BEST2 SGBDs which were not post-
processed by the STRIP tool :
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job _ARGUMENTS determines all defined arguments of a job; the name of the job to
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 23 of 106
be investigated is to be specified as job parameter when calling the virtual job. Determining the
arguments is only possible with BEST2 ECU description files, which as not subsequently processed
using the tool STRIP.
The virtual job _ARGUMENTS cannot determined the arguments actually passed at runtime, but
only the arguments defined in the job header.
The following information are stored in a separate result set for each argument:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job_RESULTS determines job results; the name of the job to be investigated is to be
specified as job parameter when calling the virtual job. Determining the results is only possible
with BEST2 ECU description files, which was not subsequently processed using the tool STRIP.
The virtual job _RESULTS cannot determine the results actually stored at runtime, but the results
defined in the job header of the ECU description file.
The following information are stored in a separate result set for each result:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job _TABLES determines all table names of the ECU description files.
Note:
For each table a separate result set is stored with text result TABLE:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 24 of 106
The system result SAETZE determines the numer of founded tables (0 ... n).
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.3. API jobs > 4.3.4. Virtual jobs
The virtual job _TABLE determines the contents of a table. The name of the table to be
investigated is to be specified as job parameter when calling the virtual job.
Note:
In each result set the contents of one line of the table is stored. The result set consists of the text
results ‚COLUMN0‘ to ‚COLUMNn‘.
... ...
The system result SAETZE determines the numer of all lines of a tables.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 25 of 106
After executing a job with apiJob(), EDIABAS loads the corresponding ECU description file and
processed the job passed. As a job is being processed, results occur which are to be passed to the
application program.
The results are stored in a data structure by EDIABAS; this structure is designated
APIRESULTFIELD.
A result field consists of a number of APIRESULTFIELDS which, on the other hand, contain a
number of RESULTS. The number of result sets and the results depends on the job in the ECU
description file.
...
Result 1 Result 2 ... Result mn Result set n
Generation of the system results via EDIABAS can be disabled via the EDIABAS configuration.
System results VARIANTE, OBJECT, JOBNAME and SAETZE, are excluded from this and
must always be stored.
All system results as well as the possible results values are described in the following summary:
0 = disabled
1 = enabled
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 26 of 106
0 = was disabled
1 = was enabled
IGNITIONCURRENT State of the ignition -1 = undefined
0 = disabled
1 = enabled
IGNITIONHISTORY History of the ignition state -1 = undefined
0 = was disabled
1 = was enabled
JOBSTATUS Summarized status message of the job (= job APITEXT[]
return value)
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results
The results of a job must be identified or read out of the result field with the following functions:
apiResultText(address,result,result set,format)
apiResultBinary(target address,length address,result,result set)
apiResultBinaryExt(target address,length address,target size,result,
result set)
The format of the result stored in the result field is the one defined and returned by the job in the
SGBD.
Irrespective of this, an application program can get a result in any desired format provided conversion
is possible.
The appropriate function must be selected for each result type desired by the application program:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 27 of 106
apiResultWord() APIWORD
apiResultLong() APILONG
apiResultDWord() APIDWORD
apiResultReal() APIREAL
apiResultText() APITEXT
apiResultBinary() APIBINARY
apiResultBinaryExt() APIBINARY
The target address is the address of the desired result variable in the application program where API
is to store the result. The name of the result to be read must be entered as the argument result (not
case sensitive).
The result functions apiResultBinary() and apiResultBinaryExt() are exceptions because they also
require the length address of an APIWORD result variable where API stores the number of copied
bytes. The result function apiResultBinaryExt() additionally requires the target size. The result
function apiResultBinary() permits the return of max. APIMAXBINARY characters. With the
result function apiResultBinaryExt() the maximum number of characters, that can be copied,
depends on the given target size (max. APIMAXBINARYEXT characters).
The format argument is another special case and is only available for the target result format
APITEXT. The format argument converts the original result format into the target result format
APITEXT with a definable conversion specification (see also section "Result types and formats"). If
the format argument is a blank string on the other hand, the result is converted to the result format
APITEXT with the default conversion.
Jobs can generate more than one result set (bundling of multiple results, e.g. error memories), which
is why the result set must always be specified (with the result set argument).
The return value of the apiResultxxx() functions indicates the existence of the desired result:
If a result set contains more than one result with the same name, only the last result can be identified.
By calling the API function apiResultFormat() you can identify the format in which a result is
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 28 of 106
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.2. Identifying results
If control unit identification is successful when a job is sent then EDIABAS stores the name of the
control unit description in the system result set (result set 0) as the result VARIANTE.
is also possible. The target address is the address of a variable in the application program where API
stores the content of the VARIANTE result.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.2. Identifying results
API automatically stores the number of result sets in the system result set (result set 0) as the result
SAETZE .
is also possible. The target address is the address of a APIWORD variable in the application program
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 29 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.2. Identifying results
The number of results in a result set can be identified with the function
The target address is the address of an APIWORD variable in the application program where API
stores the number of results of the result set result set.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.2. Identifying results
The target address is the address of a string variable in the application program where API stores the
result name.
The result index is the sequential number of a result in a result set. Valid values are 1..no., where no.
is the number of results in the set result set identified with apiResultNumber().
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.2. Identifying results
The format of the result returned by the control unit description file can be identified with the
function
The target address is the address of an APIRESULTFORMAT variable in the application program
where API stores the result format. The argument result is the result you are searching for. The result
set must be specified in the argument result set.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 30 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.3. Result types and formats
APICHAR
APIBYTE
APIINTEGER
APIWORD
APILONG
APIDWORD
APIREAL
APITEXT
APIBINARY
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.3. Result types and formats
The formatting instruction uses the apiResultText(...,Format) function and must be configured as
follows:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 31 of 106
Specifications:
[-] [digit1] [.digit2] [e,E]
| | | |
| | | |__ APIREAL: exponential representation
| | |
| | |__ APITEXT: max. number of characters specified
| | APIREAL: number of decimal places
| |
| |____ Minimum field size ²
|
|_____ left-justified formatting, otherwise
right-justified formatting
Examples:
Formatting instruction "B": Converts a result (if convertible) to the APIBYTE format, then
further converting and return of a right-justified APITEXT
string.
Formatting instruction "20T": Converts a result (if convertible) to the APITEXT format, then
further converting and return of a right-justified APITEXT
string with a total of 20 digits.
Formatting instruction "-8.2ER": Converts a result (if convertible) to the APIREAL format, then
further converting and return of a left-justified APITEXT
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 32 of 106
string with a total of 8 digits, with the result being stored in exponential representation with 2 decimal
places.
Formatting instruction "": Converts a result (if convertible) to the APITEXT format and
returns the left-justified APITEXT string.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results
(Buffer) storage and delayed evaluation of results fields by the application program is possible using
the routine described below.
CAUTION: This switch affects the result field only, the status of EDIABAS is not stored.
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.4. Application result fields
A duplicate of the current result field can be created within API with the function
apiResultsNew( )
The return is a reference to the result field (application result field) dynamically created in the main
memory. NULL indicates creation has failed.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.4. Application result fields
apiResultsScope (reference)
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 33 of 106
it is possible to switch to the application result field; a reference to the application result field is
required as a function argument (known from apiResultsNew()).
The results in the application result field can then be accessed using known evaluation methods
(apiResultxxx()).
The link to the application result field exists until new results are stored in API's own result field
(initiated by calling apiJobxxx()).
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.4. API Results > 4.4.4. Application result fields
A memory location created with apiResultsNew() can be deleted with the function
apiResultsDelete (reference)
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
Communicating with the diagnostic interface is done by accessing the interface driver .
To access the diagnostic interface (device) you must specify the device connection and the device
application:
Necessary access information for diagnostic interface = device connection + device application
The device connection is the interface to be controlled; the application to be addressed on the
interface is referred to as the device application.
When initializing API with apiInit(), EDIABAS performs system-dependent presets for device
connection and device application.
The preset uses the device driver supplied by Softing for the diagnostic bus interface.
Both the device connection and the device application must be entered as strings.
Switching to a different device connection or device application is only effective until a further
switch with apiSwitchDevice() or until API is terminated (apiEnd()).
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 34 of 106
The preset for device connection and device application can be determined by entering a blank string.
The function apiSwitchDevice() returns information about the successful switch of the device
connection and the device application:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
Basically, the following sequence must be observed. It can be repeated as often as desired:
...
apiInitxxx()
...
...
apiEnd()
...
After successful API initializing (apiInitxxx() with the return APITRUE) all other API function
calls can be executed until API is terminated (apiEnd()).
The API functions for trouble shooting are an exception to this rule - they can also be called when
API initializing fails (see section "Trouble shooting").
More:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 35 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control > 4.6.1. Job control
The following functions initiate the execution of a job that has been started but not yet finished:
The new action is carried out even when there is an error in the automatically executed job.
An error in the automatically executed job is cleared before the new action is carried out.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control > 4.6.1. Job control
In order to carry out time-critical actions of the application program while an API job is running
(e.g. keyboard polling, display configuration etc.), the processing status of the job must be polled
with
apiState ( )
apiStateExt ( suspendTime )
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 36 of 106
The return from apiState() and apiStateExt() is the job status of the (last) job started:
apiBreak ( )
This also clears any existing results and returns you to the application program.
Unlike the other job states, APIBREAK can only be initiated by the application program.
To do this, either the function apiBreak() must be called or the call-back function must be terminated
by the APITRUE return.
Job states APIBREAK and APIERROR are held until a job is started with apiJobxxx() or API is
re-initialized with apiInitxxx().
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control > 4.6.1. Job control
Instead of the EDIABAS sequence control using apiState(), it is possible to use a call-back routine in
the application program.
During an API job EDIABAS will continuously call a user-selectable function of the application
program.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 37 of 106
If EDIABAS sees the request for an immediate abort after executing the Call-Back it will terminate
the current API job (condition is APIBREAK), delete any results and return to the application
program.
Run-time request
Since a Call-Back routine is activated continuously during an API job execution, interrupting
EDIABAS every time, Call-Back routines must observe a relatively short run-time.
Constraints
No API functions may be called during a Call-Back routine apart from the apiErrorCode() and
apiErrorText() functions.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control > 4.6.1. Job control
A direct job abort initiates an error which is why all result data are lost and cannot be accessed.
An API abort with apiEnd() initiates an apiBreak() and so aborts a job in progress.
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control
During the execution of a job the execution state can be queried using the function apiJobInfo.
This function returns the execution state of a job in percent. The query mechanism must be
supported by special BEST language constructs in the control unit description file. Otherwise the
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 38 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.6. API Sequence control
EDIABAS for WIN32 permits simultaneous access to EDIABAS by several different application
programs.
In contrast to the other platforms, EDIABAS for WIN32 is no one single software which runs all
application programs consecutively. Instead, there is a separate EDIABAS for each application
program, which is started and terminated automatically under WIN32.
The interfaces available with EDIABAS may only be accessed by 1 application program at a time.
Therefore, EDIABAS for WIN32 requires an interface locking mechanism which ensures exclusive
access of an application program to an interface (device locking).
Device locking takes place if the functions apiInit(), apiInitExt() or apiSwitchDevice() are called:
If several application programs try to access the same device, all except the first one will receive
the error IFH-0029: ACCESS DENIED.
It must be taken into account that when apiInit() is called, exclusive access to the default device "_"
takes place. If another application is already accessing the default device "_", the call of apiInit()
will fail (IFH-0029: ACCESS DENIED).
Therefore, an application program can only access EDIABAS with apiInit() if all currently running
application programs have selected an interface different from “ “ with apiInitExt() or
apiSwitchDevice()!
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
4.7. Configuration
The EDIABAS configuration consists of several information pairs, each pair of which consists of
the following:
Configuration element and configuration setting each represent string with predefined contents.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 39 of 106
All EDIABAS configuration elements can be interrogated; changing the configuration setting,
however, is not possible for all configuration elements. The configuration can only be modified up
to the next API abort (apiEnd()).
A detailed description of all configuration elements and their configuration settings can be found in
reference [2].
More:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.7. Configuration
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.7. Configuration
The setting of a configuration element can be modified with the following function, provided this is
permitted by EDIABAS:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 40 of 106
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface
More:
4.8.3. Procedure for error analysis when initializing and identifying results
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.8. Trouble shooting
The error status on which an error is based can be identified by calling the function
apiErrorCode ( )
The default error text of the error can also be identified using the function
apiErrorText ( )
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.8. Trouble shooting
For error handling, the application program can define a function without arguments that the run-time
system must activate whenever an error occurs (Error Handler):
apiErrorHandler ( Action )
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 41 of 106
In the Error Handler, the error will be typically analyzed by polling apiErrorCode() or apiErrorText
().
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.8. Trouble shooting
4.8.3. Procedure for error analysis when initializing and identifying results
As well as the return APIFALSE, for functions with APIBOOL return an API error can be
identified in one of the following two ways (see also the section on "Trouble shooting"):
By calling the API function apiResultFormat() you can check whether the desired result format
even exists:
EDIABAS API Developer's Guide > API Interface Description > 4. Operating the API interface >
4.8. Trouble shooting
Errors remain set until a job is started by apiJobxxx(), the device is changed with apiSwitchDevice(),
or until API is re-initialized with apiInitxxx().
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 42 of 106
The errors API-0005 and API-0014 are special cases; these will also be reset during the next result
query with apiResultXxx().
5. Application example
/********************************************************************
***
***
*********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <ctype.h>
#include "api.h"
#define TRUE 1
#define FALSE 0
#define LINESIZE 33
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 43 of 106
/*
* Quit !!
*/
apiEnd();
exit(exitCode);
/*
*/
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 44 of 106
quit(1);
/*
* Parameter:
* - fp
* - yb
* - yn
*/
/* line format: */
/* line 0 25 */
/* XXX: XX XX XX XX XX XX XX XX XXXXXXXX */
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 45 of 106
unsigned n=0,z,hexz;
while (n<yn) {
line[LINESIZE]=addr[0]='\0';
z=hexz=0;
if (z==0)
sprintf(addr,"%03X:",n);
else
hexz++;
sprintf(&line[hexz],"%02X",yb[n]);
hexz+=2;
line[hexz]=' ';
line[LINESIZE-8+z]=(isprint((int)yb[n])? yb[n]:'.');
n++;
z++;
fprintf(fp,"\n %s %s",addr,line);
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 46 of 106
/*
* Parameter:
* - fp
* otherwise APIFALSE
*/
APICHAR c;
APIBYTE b;
APIINTEGER n;
APIWORD yn,w,set,s,index,i;
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 47 of 106
APILONG l;
APIDWORD d;
APIREAL r;
APIRESULTFORMAT format;
APIBOOL ret=APITRUE;
if (fp!=NULL)
fprintf(fp,"RESULTFIELD:\n\n");
if (apiResultSets(&s)) {
if (fp!=NULL)
fprintf(fp,"SET %3u:",set);
if (apiResultNumber(&i,set)) {
for(index=1;
(index<=i)&&(apiErrorCode()==EDIABAS_ERR_NONE);
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 48 of 106
index++)
if (apiResultName(text,index,set)) {
if (fp!=NULL)
(index==1)?"":" ",index);
if (apiResultFormat(&format,text,set)) {
switch (format) {
case APIFORMAT_CHAR:
if (apiResultChar(&c,text,set))
if (fp!=NULL)
break;
case APIFORMAT_BYTE:
if (apiResultByte(&b,text,set))
if (fp!=NULL)
break;
case APIFORMAT_INTEGER:
if (apiResultInt(&n,text,set))
if (fp!=NULL)
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 49 of 106
break;
case APIFORMAT_WORD:
if (apiResultWord(&w,text,set))
if (fp!=NULL)
break;
case APIFORMAT_LONG:
if (apiResultLong(&l,text,set))
if (fp!=NULL)
break;
case APIFORMAT_DWORD:
if (apiResultDWord(&d,text,set))
if (fp!=NULL)
break;
case APIFORMAT_REAL:
if (apiResultReal(&r,text,set))
if (fp!=NULL)
break;
case APIFORMAT_TEXT:
if (apiResultText(t,text,set,""))
if (fp!=NULL)
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 50 of 106
text,'"',t,'"');
break;
case APIFORMAT_BINARY:
if (apiResultBinary(yb,&yn,text,set)) {
if (fp!=NULL) {
text,yn);
printBinary(fp,yb,yn);
break;
if (fp!=NULL)
fprintf(fp,"\n");
return ret;
/*
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 51 of 106
program start
*/
FILE *fp;
time_t start,stop;
unsigned loop=0i=0;
char c;
int showStatus=FALSE;
printf("\n%s\n\n","APIDEMO V1.1");
sscanf(buffer,"%u",&loop);
gets(buffer);
sscanf(buffer,"%c",&c);
if (c=='y' || c=='Y')
showStatus=TRUE;
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 52 of 106
getchar();
printf("\n");
time(&start);
for (i=1;i<=loop;i++) {
if (showStatus)
printf("\Pass #%03d...",i);
if (!apiInit()) {
quit(1);
if (showStatus)
printf("Ok.\n\n");
apiJob(ecu,job,data,result);
if (apiState()==APIERROR) {
continue;
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 53 of 106
if (showStatus){
printf("Ok.\n");
if(!printResultField(stdout))
error();
apiEnd();
time(&stop);
i-1,difftime(stop,start));
quit(0);
A. List of references
[1] EDIABAS: Error Reference
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 54 of 106
1. Update history
2. Introduction
5. Other Functions
A. List of references
1. Update history
Version 3.0 First release
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 55 of 106
2. Introduction
More:
2.2. Conventions
EDIABAS API Developer's Guide > API Function Primer > 2. Introduction
This manual describes the constants and functions that are available in the EDIABAS-API
interface. Reference [5] gives a detailed description of their use. Linking into a development
environment is described in Reference [6]. You will find general information about EDIABAS and
control unit description files in Reference [4].
EDIABAS API Developer's Guide > API Function Primer > 2. Introduction
2.2. Conventions
Example Description
SAMPLE.C Upper case characters are used for filenames, registers and
operating system commands.
apiJob, Bold type is used for key words and operators of the
APIREADY BEST/2 and BEST/1 languages and for API functions. In
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 56 of 106
.}
[1] Reference to a document in References.
EDIABAS API Developer's Guide > API Function Primer > 2. Introduction
The abbreviations used in this and all other EDIABAS documents are explained in the
"GLOSSARY" section of the "EDIABAS User Manual".
3.2. Constants
EDIABAS API Developer's Guide > API Function Primer > 3. Data types, constants and error
messages
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 57 of 106
VB.NET:
Boolean
APICHAR char è Byte *) char Result type
APIBYTE unsigned char VB 4.0/6.0/.NET: byte Result type
Byte
APIINTEGER short VB 3.0/4.0/6.0: short Result type
Integer
VB.NET:
Short
APIWORD unsigned short è Integer *) ushort Result type
APILONG long VB 3.0/4.0/6.0: int Result type
Long
VB.NET:
Integer
APIDWORD unsigned long Long uint Result type
APIREAL double Double double Result type
APITEXT[] char[] String string Result type
APIBINARY[] unsigned char[] VB 3.0: byte[] Result type
String
VB 4.0/6.0/.NET:
Array of Byte
è substitute data type *)
As well as the simple data types, this primer also defines the complex data type APIRESULTFIELD
which represents a reference to a result field.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 58 of 106
Variables of the APIRESULTFIELD data type can be used like variables of simple data types (e.g.
APIBYTE).
All API data types are not available under Visual Basic and C#.
EDIABAS API Developer's Guide > API Function Primer > 3. Data types, constants and error
messages
3.2. Constants
Constant Purpose
APIMAXCONFIG Maximum recommended buffer size for configurationsetting
(including termination character)
APIMAXDEVICE Maximum length of device arguments connection and
application (including last character)
APIMAXNAME Maximum length of job arguments control unit and name, result
names and format strings (including last character)
APIMAXSTDPARA Maximum length of the job argument Parameter for standard
jobs
APIMAXPARA Maximum length of job argument parameter (including last
character if argument exists as a string) for job calls using
apiJob
APIMAXPARAEXT Maximum length of job argument parameter (including last
character if argument exists as a string) for job calls using
apiJobData and apiJobExt
APIMAXRESULT Maximum length of job argument result (including last
character)
APIMAXTEXT Maximum and recommended size of APITEXT result buffer
(including last character)
APIMAXBINARY Maximum and recommended size of APIBINARY result buffer
for apiResultBinary
APIMAXBINARYEXT Maximum and recommended size of APIBINARY result buffer
for apiResultBinaryExt
APIMAXFILENAME Maximum and recommended size of file names (including final
character)
APIBUSY BUSY status of EDIABAS
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 59 of 106
EDIABAS API Developer's Guide > API Function Primer > 3. Data types, constants and error
messages
Error code
When an error occurs the application program can get the error code from EDIABAS with the
function apiErrorCode() and/or the default error text with the function apiErrorText().
Each error code is assigned an error symbol that can be referenced as part of error handling in the
application program.
EDIABAS_XXX_####
The XXX group of characters denotes the EDIABAS-internal origin area of the error, and the
number #### is the corresponding error number.
EDIABAS_API_#### API
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 60 of 106
Document [1] gives a full list of errors together with their error symbol, error code, default error text
and a description of the error message.
• Summary A brief description of the function, giving C/C++ syntax and arguments.
The syntax of the function for Visual Basic und the DLL interface is
defined in the files API.BAS and APIDLL.H. The syntax of the
function for C# and Visual Basic.NET is defined in the files
APINET32.DLL and APIVBNET32.DLL. These files are described
in [6].
• Interface Lists all interfaces which support the functions (C/C++, Visual Basic, C#
and DLL interface). A detailed description on these interfaces can be
found in reference [6].
More:
apiBreak
apiCallBack
apiCheckVersion
apiEnd
apiErrorCode
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 61 of 106
apiErrorHandler
apiErrorText
apiGetConfig
apiInit
apiInitExt
apiJob
apiJobData
apiJobExt
apiJobInfo
apiResultBinary
apiResultBinaryExt
apiResultByte
apiResultChar
apiResultDWord
apiResultFormat
apiResultInt
apiResultLong
apiResultName
apiResultNumber
apiResultReal
apiResultsDelete
apiResultSets
apiResultsNew
apiResultsScope
apiResultText
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 62 of 106
apiResultVar
apiResultWord
apiSetConfig
apiState
apiStateExt
apiSwitchDevice
apiTrace
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiBreak
void apiBreak ( )
Remarks The function apiBreak() can be used to abort an ongoing job execution
(automatic call with apiEnd()). Any results are lost.
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiCallBack
Remarks The ongoing job execution can be controlled by the APIBOOL return of the
call-back routine:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 63 of 106
EDIABAS only calls the call-back routine with the functions apiState/
apiStateExt or apiResultxxx!
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiCheckVersion
char *versionInfo)
Remarks Check of the compatibility of the API returning the current API version. The
required API minimum version has to be passed in versionCompatibility
(0xMMmm: MM = major version, mm=minor version), e.g. 0x0700 for API
7.0.x. For a compatibility with the current Application Development Kit
APICOMPATIBILITYVERSION has to be passed. The current API
version is copied to the target variable versionInfo.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 64 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiEnd
void apiEnd ( )
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiErrorCode
int apiErrorCode ( )
Remarks This function may also be used out of apiInit() and apiInitExt(...). If apiInit
() or apiInitExt(...) return APIFALSE you can get the error code by
apiErrorCode()
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiErrorHandler
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 65 of 106
Remarks The error handler function in the application program is called by EDIABAS
whenever an EDIABAS error occurs.
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiErrorText
Remarks This function may also be used out of apiInit() and apiInitExt(...). If apiInit()
or apiInitExt(...) return APIFALSE you can get the error text by
apiErrorText()
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiGetConfig
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 66 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiInit
Summary Initializes the EDIABAS components: API, run-time system and interface
handler.
APIBOOL apiInit ( )
Remarks The apiInit (or apiInitExt) function must have run successfully before further
API functions are called, exept for apiErrorCode() and apiErrorText().
The run-time system is initialized and locked off for other application programs
(application locking).
Presets device connection and device application.
Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiInitExt
Summary Initializes the EDIABAS components: API, runtime system and Interface
Handler.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 67 of 106
Remarks The function apiInitExt (or apiInit) must have run successfully before other
API functions are called, except for apiErrorCode() and apiErrorText().
Those functions return the error, when apiInit() or apiInitExt(...) fails.
The runtime system is initialized and locked for other application programs
(application locking).
Setting a interface handler different from the default setting is only supported
by WIN32/WIN64. The settings for a interface handler, device name and
device application are only valid to the API end (apiEnd).
For the structure of the diagnostic interface file name, the rules
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 68 of 106
apiJob
void apiJob ( const char *ecu, const char *job, const char *para, const char *result )
job Job to be sent, the job name is defined in the addressed SGBD (max.
APIMAXNAME)
Remarks Sends a job to EDIABAS without waiting for the job to finish executing. The
argument ecu is first processed as the name of a variant description file. If
this file (ecu.prg) does not exist it is processed as a group description file
(ecu.grp)
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiJobData
void apiJobData ( const char *ecu, const char *job, const unsigned char *parabuf,int
paralen, const char *result )
job Job to be sent, the job name is defined in the addressed SGBD (max.
APIMAXNAME)
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 69 of 106
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiJobExt
void apiJobExt ( const char *ecu, const char *job, const unsigned char *stdpara,int
stdparalen, const unsigned char *para, int paralen, const
char *result, long reserved ))
job Job to be issue; the job name is determined in the addressed ECU description
file (max. APIMAXNAME)
stdparalen Number of data bytes of the job parameter for the standard jobs
Return -
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 70 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiJobInfo
See also -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultBinary
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 71 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultBinaryExt
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 72 of 106
The desired result result is downloaded from the result set set in the result field and copied to the
target variable buf in the application program. The number of copied bytes
is copied to the target variable buflen. The maximum number of copied
characters of the APIBINARY type is either bufsize or
APIMAXBINARY. If the result is not in APIBINARY format there is no
conversion to APIBINARY format.
Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultByte
Remarks Identifies an APIBYTE result. Waits for an ongoing job to finish processing.
The desired result result is downloaded from the result set set in the result
field and copied to the target variable buf of the application program. If the
result is not in APIBYTE format but type conversion is possible, then it is
converted to APIBYTE format. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 73 of 106
apiResultChar
Remarks Identifies an APICHAR result. Waits for an ongoing job to finish processing.
The desired result result is downloaded from the result set set in the result
field and copied to the target variable buf in the application program. If the
result is not in APICHAR format but type conversion is possible, then it is
converted to APICHAR format. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultDWord
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 74 of 106
consequently stored.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultFormat
Remarks Identifies the format of a result. Waits for an ongoing job to finish processing.
The format of the desired result result is downloaded from the result set set
in the result field and copied to the target variable buf in the application
program.
APIFORMAT_CHAR
APIFORMAT_BYTE
APIFORMAT_INTEGER
APIFORMAT_WORD
APIFORMAT_LONG
APIFORMAT_DWORD
APIFORMAT_TEXT
APIFORMAT_BINARY
APIFORMAT_REAL
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 75 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultInt
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultLong
Remarks Identifies an APILONG result. Waits for an ongoing job to finish processing.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 76 of 106
The desired result result is downloaded from the result set set in the result field and copied to the
target variable buf in the application program. If the result is not in
APILONG format but type conversion is possible, then it is converted to
APILONG format. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultName
Remarks Identifies the result name, giving the result index and the result set. Waits for
an ongoing job to finish processing. The result name is identified from the
specified result index index (starting with 1) and the result set set of the
result field and copied to the target variable buf in the application program.
APIMAXNAME is the maximum number of copied characters and
therefore the recommended buffer size of the target variables. Affects error
status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultNumber
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 77 of 106
Remarks Identifies the number of results in a result set. Waits for an ongoing job to
finish processing. The number of results is identified from the specified
result set set in the result field and copied to the target variable buf in the
application program. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultReal
Remarks Identifies an APIREAL result. Waits for an ongoing job to finish processing.
The desired result result is downloaded from the result set set in the result
field and copied to the target variable buf in the application program. If the
result is not in APIREAL format but type conversion is possible, then it is
converted to APIREAL format. Affects error status.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 78 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultsDelete
Remarks -
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultSets
Remarks Simplified identification of the number of result sets (of the last job). Waits for
an ongoing job to finish processing. The number of result sets is identified
and copied to the target variable sets in the application program. The result
can also be identified with apiResultWord(sets,"SAETZE",0). Affects
error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultsNew
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 79 of 106
APIRESULTFIELD apiResultsNew ( )
Remarks Dynamic creation of a copy of the current result field. Can only create one
copy of the current result field. Waits for an ongoing job to finish
processing. Affects error status.
Return Reference to created result field copy or NULL in the event of an error.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultsScope
Remarks Switches to an application specific result field. The lock onto the result field
persists until the next job or apiResultsScope function call.
Return -
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultText
APIBOOL apiResultText ( APITEXT *buf, const char *result, APIWORD set, const
char *format )
format Desired format of the result (max. APIMAXNAME), a blank string must be
specified to perform the default conversion.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 80 of 106
Remarks Identifies an APITEXT result. Waits for an ongoing job to finish processing.
The desired result result is downloaded from the result set set in the result
field and copied to the target variable buf in the application program.
APIMAXTEXT is the maximum number of copied characters of the
APITEXT type and therefore the recommended buffer size of the target
variable. If the buffer size is exceeded the result is limited to
APIMAXTEXT. The conversion instruction format can be used to convert
the result to the APITEXT format. If the format argument is a blank string,
then there is default conversion. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultVar
Remarks Identifies the name of the loaded SGBD of the last job. Waits for an ongoing
job to finish processing. The name is identified and copied to the target
variable ecu in the application program. The name is stored in the system
result set (result set 0) as the result VARIANTE. The result can also be
identified with apiResultText(ecu,"VARIANTE",0,""). The size of the
APITEXT result copied by API can be the maximum length of the
filename. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiResultWord
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 81 of 106
Remarks Identifies an APIWORD result. Waits for an ongoing job to finish processing.
The desired result result is downloaded from the result set set in the result
field and copied to the target variable buf in the application program. If the
result is not in APIWORD format but type conversion is possible, then it is
converted to APIWORD format. Affects error status.
Visual Basic: For a result >= 2^15 (32768) a negative value is stored.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiSetConfig
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 82 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiState
int apiState ( )
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiStateExt
Remarks: The function optionally executes a suspension of the application. The passed
suspend time suspendTime should be understood as an optimum target
value, i.e. the use of the exact given time is not guaranteed. Passing a
suspend time of 0 milliseconds is equivalent to calling the function
apiState.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 83 of 106
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiSwitchDevice
Remarks: A device change is possible by specifying the new device connection and
device application. The new device is valid until apiEnd(), apiInit() or
apiInitExt() are called. Affects error status.
EDIABAS API Developer's Guide > API Function Primer > 4. API function Primer
apiTrace
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 84 of 106
Remarks Writes the given message msg to the API trace, if tracing is activated. Does
not affect error status.
Return -
See also -
5. Other Functions
More:
enableServer
closeServer
enableMultiThreading
EDIABAS API Developer's Guide > API Function Primer > 5. Other Functions
enableServer
Remarks Check or suppress IFH locking. At the time of call NO application is permitted
to be registered with EDIABAS, i.e. the switch is not permitted between
apiInit()/apiInitExt() and apiEnd() of an application. The function is
available under WIN32/WIN64 (the function has no effect under WIN64).
onOff = FALSE:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 85 of 106
EDIABAS API Developer's Guide > API Function Primer > 5. Other Functions
closeServer
void closeServer ( )
Return -
EDIABAS API Developer's Guide > API Function Primer > 5. Other Functions
enableMultiThreading
Remarks This function can be used to switch from single-threading mode (standard) to
multi-threading mode. At the time of switch NO application is permitted to
be registered with EDIABAS, i.e. the switch must be done before the first
call to apiInit()/apiInitExt() of an application. The function is available
under WIN32/WIN64 (the function has no effect under WIN64).
is not supported
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 86 of 106
See also -
A. List of references
[1] EDIABAS: Error Reference
1. Update History
2. Introduction
3. General
A. LIST OF REFERENCES
1. Update History
Version 3.0 First Version
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 87 of 106
2. Introduction
More:
2.2. Conventions
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 2. Introduction
This manual describes the interface of the EDIABAS transparent mode. It has been written for use
by developers of diagnostic software who work with the API interface, and is based on the API
Interface Description [1] and the EIDBSS documentation [2]. API functions and interface functions
are only detailed so far as is necessary for an understanding of the transparent mode. The emphasis
is on descriptions of the individual TMODE functions. These functions are the jobs provided by the
special description file for the transparent mode with the name "TMODE". You will find general
information about EDIABAS and control unit description files in Reference [4].
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 2. Introduction
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 88 of 106
2.2. Conventions
Example Description
SAMPLE.B2V Upper case characters are used for filenames, registers and
operating system commands.
job, string, while Bold type is used for key words and operators of the
BEST/2 and BEST/1 languages and for API functions. In
syntax descriptions these words must be written as shown.
.}
[1] Reference to a document in References.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 2. Introduction
The abbreviations used in this and all other EDIABAS documents are explained in the
"GLOSSARY" section of the "EDIABAS User manual and installation guide".
3. General
The transparent mode of EDIABAS enables the developer of diagnostic/coding software to directly
access the interface and control units with the help of a special description file. With the transparent
mode, the data that are interchanged between the interface and the application program or between
the control unit and the application program are not processed in a control unit-specific description
file but in the application program itself.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 89 of 106
This means that the diagnostic data are accessed at message level and not at symbolic level.
EDIABAS still performs error handling however (e.g. communication errors). With the aid of the
transparent mode it is therefore possible to export existing diagnostic software to EDIABAS without
having to make structural changes to the existing application program.
The description file known as "TMODE" provides basic utilities for the transparent mode. These
utilities are referred to in the sections that follow as TMODE functions.
• Reset interface
apiJobData/apiJobExt
apiResultBinary
More:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 90 of 106
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 4. The
Programming Interface
Access to the interface and beyond it to a control unit is possible by sending an API job to
EDIABAS. In the transparent mode this job always has the following structure:
or
apiJobExt( description file, job, standard data buffer, standard data length,
The description file of the transparent mode is called "TMODE", and makes the link to the TMODE
functions. Each TMODE function is implemented in the description file as a separate job.
The name of the TMODE function (e.g. "SENDE_TELEGRAMM") is entered as the job (see the
section on "TMODE Functions").
Data required by the TMODE function are entered in a data buffer (e.g. message data 35,00,05,00 for
reading the identification data from the LSM control unit). Data length gives the number of data
bytes (e.g. number of data is 4 for reading the identification data from the LSM control unit).
In the transparent mode "" is always entered as the parameter result because this parameter is not
evaluated in the TMODE description file.
Using the API function apiJobExt standard data buffer must be set on “”, standard data length must
be set on 0 and reserved must be set on 0.
In transparent mode the same description file ("TMODE") is used for all control units.
Syntax:
Parameter:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 91 of 106
parabuf Data bytes. The data bytes depend on the TMODE function.
Return: -
Example:
int telegramLength=4;
apiJobData("TMODE","SENDE_TELEGRAMM",
telegram,telegramLength,"");
Syntax:
Parameter:
stdparabuf Data bytes for standard jobs. This parameter is not supported by
TMODE: ""
stdparalen Number of data bytes for standard jobs. This parameter is not
supported by TMODE: 0
parabuf Data bytes. The data bytes depend on the TMODE function.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 92 of 106
Return: -
Example:
int telegramLength=4;
apiJobExt("TMODE","SENDE_TELEGRAMM","",0,
telegram,telegramLength,"",0L);
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 4. The
Programming Interface
In the transparent mode, the application programme gets the results of a job sent by the function
apiJobData/apiJobExt with the function
The target address buffer is the address of a variable in the application programme (field for data
bytes) where EDIABAS stores the result. The target address length is the address of an APIWORD
variable in the application programme where EDIABAS stores the number of bytes received. The
name of the result to be read must be entered as the parameter result (not case sensitive). The result
names are defined in the separate TMODE functions. All results are in result set 1.
The error status is affected, i.e. if an error occurs during processing then the error number and error
text can be polled by API functions (see [1]).
Syntax:
Parameters:
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 93 of 106
Return:
APIBINARY telegram[APIMAXPARA];
APIWORD telegramLength;
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 4. The
Programming Interface
In this section an example in language C is used to demonstrate the part of the application program in
which utilities are requested by EDIABAS.
The first part sets the control unit parameters. No result is polled after these parameters are set
because this utility does not return a result.
The second part requests the control unit's identification data. After the message is sent the control
unit's answer message is polled.
First, a job is always sent using the API function apiJobData/apiJobExt. Then apiState is called
cyclically in a loop until EDIABAS has finished processing the job. Actions such as keyboard polling
can be executed in this loop again and again. When the job is finished the result is polled with
apiResultBinary. Depending on the return value of apiResultBinary (TRUE or FALSE), the system
continues processing the result or error handling is carried out. If no result is expected, apiState
checks whether an error has occurred when processing is finished.
int cuParameterLength= 9;
int requestTelLength = 4;
APIBINARY answerTel[APIMAXBINARY];
APIWORD answerTelLength;
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 94 of 106
apiJobData("TMODE",
"SETZE_SG_PARAMETER_EIDBSS",
cuParameter,cuParameterLength,
"");
if (apiState() == APIREADY) {
else {
apiJobData("TMODE","SENDE_TELEGRAMM",
requestTel,requestTelLength,
"");
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 95 of 106
else {
apiJobData("TMODE",
apiResultBinary(
A string of characters of the unsigned char type is always specified as parameters. To specify
variables of the int, long etc. type, they must first be converted, in which case the first character is the
least significant and the last is the most significant character (Intel format).
The results are also specified as a string of characters of the APIBINARY type. If the results are to
be interpreted as variables of the int, long etc. type, they must also be converted first. The results
are also specified in Intel format.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 96 of 106
More:
5.2. INITIALISIERUNG
5.3. SETZE_INTERFACE_ZURUECK
5.4. SETZE_SG_PARAM_ZURUECK
5.5. SETZE_SG_PARAMETER_ALLG
5.6. SETZE_SG_PARAMETER_EIDBSS
5.7. SETZE_ANTWORTLAENGE
5.8. HOLE_KEYBYTES
5.9. SENDE_TELEGRAMM
5.10. SENDE_TELEGR_WIEDERHOLT
5.11. HOLE_ANTWORT_TELEGR
5.12. STOPPE_WIEDERH_ANFORDERUNG
5.13. LESE_INTERFACE_TYP
5.14. LESE_INTERFACE_VERSION
5.15. LESE_SPANNUNG_KL30
5.16. LESE_SPANNUNG_KL15
5.17. LESE_PORT
5.18. SETZE_PORT
5.19. SETZE_PROGRAMMIERSPANNUNG
5.20. SETZE_SIA_RELAIS
5.21. TESTE_DIAGNOSELEITUNG
5.22. HOLE_INTERFACE_STATUS
5.23. REICHE_AN_INTERFACE_DURCH
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 97 of 106
5.24. SETZE_TRAP_MASK_REGISTER
5.25. LIES_TRAP_MASK_REGISTER
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
• INITIALISIERUNG
• SETZE_INTERFACE_ZURUECK
• SETZE_SG_PARAM_ZURUECK
• SETZE_SG_PARAMETER_ALLG
• SETZE_SG_PARAMETER_EIDBSS
• SETZE_ANTWORTLAENGE
• HOLE_KEYBYTES
• SENDE_TELEGRAMM
• SENDE_TELEGR_WIEDERHOLT
• HOLE_ANTWORT_TELEGR
• STOPPE_WIEDERH_ANFORDERUNG
• LESE_INTERFACE_TYP
• LESE_INTERFACE_VERSION
• LESE_SPANNUNG_KL30
• LESE_SPANNUNG_KL15
• LESE_PORT
• SETZE_PORT
• SETZE_PROGRAMMIERSPANNUNG
• SETZE_SIA_RELAIS
• TESTE_DIAGNOSELEITUNG
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 98 of 106
• HOLE_INTERFACE_STATUS
• REICHE_AN_INTERFACE_DURCH
• SETZE_TRAP_MASK_REGISTER
• LIES_TRAP_MASK_REGISTER
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.2. INITIALISIERUNG
Jobname: INITIALISIERUNG
Parameters: None
Result name: DONE
Result contents: Value 1 as a 2-byte number
Description: This job is called automatically whenever the description file is loaded or an
EDIABAS error has occurred. It defines which interface is connected. This
job requires the result DONE that is interpreted by the EDIABAS system. In
the transparent mode this result is always 1.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.3. SETZE_INTERFACE_ZURUECK
Jobname: SETZE_INTERFACE_ZURUECK
Parameters: None
Result name: -
Result contents: None
Description: This job puts the interface in the initialising state and tests the diagnostic
interface. The EDIC (IDBSS) will not accept a command for about 2 seconds
after the job.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.4. SETZE_SG_PARAM_ZURUECK
Jobname: SETZE_SG_PARAM_ZURUECK
Parameters: None
Result name: -
Result contents: None
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 99 of 106
Description: This job breaks off communication with a control unit and cancels the
communication parameters. Any message from the control unit still stored in
the EDIC (IDBSS) is lost.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.5. SETZE_SG_PARAMETER_ALLG
Jobname: SETZE_SG_PARAMETER_ALLG
Parameters: The communication parameters are defined as the parameters.
You will find a detailed description of the parameters in [7] in the description
of the set_communication_pars function.
Result name: -
Result contents: None
Description: This job sets the communication parameters required for communicating with a
control unit. The parameter format is independent from the interface. Once
parameters are set with this job it is not necessary to change the user software
when there is a change of interface. The job must be called before any new
control unit is addressed. As well as the communication parameters the
message leader is filled with default values in EDIABAS depending on the
set concept. See 5.7 for further details about message leaders.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.6. SETZE_SG_PARAMETER_EIDBSS
Jobname: SETZE_SG_PARAMETER_EIDBSS
Parameters: The communication parameters are defined as the parameters. The parameters
must have the format requested by the EIDBSS application on the EDIC, see
[2]. The check bytes are not transferred.
Result name: -
Result contents: None
Description: This job sets the communication parameters required for communicating with a
control unit. The parameter format is dependent on the interface. Once
parameters are set with this job the user software must be changed when
there is a change of interface. The job must be called before any new control
unit is addressed. As well as the communication parameters the message
leader is filled with default values in EDIABAS depending on the set
concept. See 5.7 for further details about message leaders.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.7. SETZE_ANTWORTLAENGE
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 100 of 106
Jobname: SETZE_ANTWORTLAENGE
Parameters: The message leader is defined as the parameter. The message leader consists of
two parameters, each comprising two bytes. The first parameter is the answer
length and the second is the answer offset.
Answer length: This indicates the length of the anticipated CU answer.
concept 2 and 4:
Answer offset: Variable answer length with concept 1, DS1, DS2 only.
The answer length is computed as follows:
Length = (answer length + 1) + answer offset
Default value for the message leader after the control unit parameters are set:
Result name: -
Result contents: None
Description: When it sends a message the interface needs a message leader containing
information about the anticipated answer length and answer offset. This
information is the same for most CU messages. By setting the leader with
SETZE_ANTWORTLAENGE the user can avoid having to transmit it with
every message. The leader is automatically set at the beginning of the
message when it is sent. If the user does not set a leader the system uses the
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 101 of 106
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.8. HOLE_KEYBYTES
Jobname: HOLE_KEYBYTES
Parameters: None
Result name: KEYBYTES
Result contents: Control unit keybytes
Description: This job reads the key bytes and identification data from a concept 2, concept 3
or a concept 4 control unit. The control unit is woken up automatically if it
has not yet been triggered.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.9. SENDE_TELEGRAMM
Jobname: SENDE_TELEGRAMM
Parameters: Control unit message according to the CU specifications. The checksum is
omitted with concept 2, DS1 and DS2 control units. The ETX at the block
end is omitted with concept 2 and concept 4 control units.
Result name: SG_ANTWORT
Result contents: Control unit answer. With concept 2 and 4 control units the answer blocks are
appended to each other, omitting the last byte of each block (ETX).
Description: This job sends a message to a control unit and gets the answer.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.10. SENDE_TELEGR_WIEDERHOLT
Jobname: SENDE_TELEGR_WIEDERHOLT
Parameters: Control unit message according to the CU specifications. The checksum is
omitted with concept 2, DS1 and DS2 control units. The ETX at the block
end is omitted with concept 2 and concept 4 control units.
Result name: -
Result contents: None
Description: This job sends the defined control unit message to the control unit repeatedly.
This mode can be terminated with the job
STOPPE_WIEDERH_ANFORDERUNG. In this mode a renewed call of
SENDE_TELEGR_WIEDERHOLT or a call of SENDE_TELEGRAMM is
answered with the error message IFH_0006.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 102 of 106
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.11. HOLE_ANTWORT_TELEGR
Jobname: HOLE_ANTWORT_TELEGR
Parameters: None
Result name: SG_ANTWORT
Result contents: Control unit answer message. With concept 2 and 4 control units the answer
blocks are appended to each other, omitting the last byte of each block
(ETX).
Description: If the repeated request for control unit answers has been started with
SENDE_TELEGR_WIEDERHOLT, the answers can now be polled with
this job. It is always the current CU answer which is polled.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.12. STOPPE_WIEDERH_ANFORDERUNG
Jobname: STOPPE_WIEDERH_ANFORDERUNG
Parameters: None
Result name: -
Result contents: None
Description: This job stops the repeated sending and receiving of messages.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.13. LESE_INTERFACE_TYP
Jobname: LESE_INTERFACE_TYP
Parameters: None
Result name: TYP
Result contents: "IDBSS" or "EIDBSS"
Description: This job polls the interface type as a zero-terminating string. "EIDBSS" is the
name of the application (diagnostic software) on the EDIC.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.14. LESE_INTERFACE_VERSION
Jobname: LESE_INTERFACE_VERSION
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 103 of 106
Parameters: None
Result name: VERSION
Result contents: Version number as low and high byte
Description: This job polls the version number of the interface.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.15. LESE_SPANNUNG_KL30
Jobname: LESE_SPANNUNG_KL30
Parameters: None
Result name: SPANNUNG
Result contents: Four byte value that indicates voltage in mV.
Description: This job polls the voltage at terminal 30 in mV.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.16. LESE_SPANNUNG_KL15
Jobname: LESE_SPANNUNG_KL15
Parameters: None
Result name: SPANNUNG
Result contents: Four byte value that indicates voltage in mV.
Description: This job polls the voltage at terminal 15 in mV.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.17. LESE_PORT
Jobname: LESE_PORT
Parameters: One byte indicating the port number.
Result name: PORTWERT
Result contents: Four byte value indicating the port value.
Port 0 -5: analog input 0 - 5 (voltage in mV)
Port 6: analog input T 15 (voltage in mV)
Port 7: analog input T 30 (voltage in mV)
Port 8: jumper field (digital value)
Description: With EDIC nine ports can be read. Ports 0 to 7 are analog inputs, port 8 polls
the value of the jumper field.
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 104 of 106
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.18. SETZE_PORT
Jobname: SETZE_PORT
Parameters: The first byte indicates the port number. Bytes 2 to 4 indicate the value at which
the port is set.
Port 9: digital outputs
Result name: -
Result contents: None
Description: Ports can be set with this job. Only port 9 (digital outputs) can be set in EDIC.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.19. SETZE_PROGRAMMIERSPANNUNG
Jobname: SETZE_PROGRAMMIERSPANNUNG
Parameters: Four byte value giving the programming voltage in mV.
Result name: -
Result contents: None
Description: This job turns the programming voltage on and off. The programming voltage
level can be given in mV (0 - 3300 mV). A 0 V voltage means programming
voltage is "off", otherwise "on".
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.20. SETZE_SIA_RELAIS
Jobname: SETZE_SIA_RELAIS
Parameters: Switching time in milliseconds as a 2 byte value.
Switching time = 0x0000: de-energize permanently
Switching time = 0xFFFF: energize permanently
Result name: -
Result contents: None
Description: This job energizes the EDIC service interval relay for the specified time.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.21. TESTE_DIAGNOSELEITUNG
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 105 of 106
Jobname: TESTE_DIAGNOSELEITUNG
Parameters: None
Result name: ERGEBNIS
Result contents: Test result as a 2 byte value.
0: Error occurred
1: No error occurred
Description: This job tests the diagnostic lead; there must be a short between the RD and TD
leads.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.22. HOLE_INTERFACE_STATUS
Jobname: HOLE_INTERFACE_STATUS
Parameters: None
Result name: IF_STATUS
Result contents: Status bytes of the interface
Description: This job requests the status bytes of the interface (see [2]).
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.23. REICHE_AN_INTERFACE_DURCH
Jobname: REICHE_AN_INTERFACE_DURCH
Parameters: Job to the interface (see [2])
Result name: IF_ANTWORT
Result contents: Answer from interface
Description: This job passes the data bytes sent to the EDIABAS direct to the interface.
EDIABAS does not evaluate the answer from the interface. This job does not
evaluate the status byte from the interface.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.24. SETZE_TRAP_MASK_REGISTER
Jobname: SETZE_TRAP_MASK_REGISTER
Parameters: Sets the trap mask register with the long value defined as parameter 1.
Result name: -
Result contents: None
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020
EDIABAS API Developer's Guide Page 106 of 106
Description: This job sets the trap mask register that can handle the occurrence of an error in
the description file.
EDIABAS API Developer's Guide > Transparent Mode Interface Description > 5. The TMODE
Functions
5.25. LIES_TRAP_MASK_REGISTER
Jobname: LIES_TRAP_MASK_REGISTER
Parameters: -
Result name: TMR
Result contents: Current value of the trap mask register
Description: This job reads the trap mask register that can handle the occurrence of an error
in the description file.
A. LIST OF REFERENCES
[1] EDIABAS: API Interface Description
file:///C:/Users/sgtma/AppData/Local/Temp/~hhF68F.htm 7/16/2020