Академический Документы
Профессиональный Документы
Культура Документы
EDIABAS
Electronic Diagnostic Basic System
BEST2RTL.DOC
CONTENTS
CONTENTS
1.
Revision history
2.
Introduction
2.1.
2.2.
Conventions
10
2.3.
11
3.
Overview
12
3.1.
12
3.2.
4.
12
3.1.2.
12
13
3.2.1.
Communication functions
14
3.2.2.
Interface functions
15
3.2.3.
16
3.2.4.
String functions
17
3.2.5.
Conversion functions
18
3.2.6.
Real functions
19
3.2.7.
Data functions
20
3.2.8.
File functions
21
3.2.9.
Sequence control
22
23
24
25
3.2.13. Configuration
26
27
Clamp states
28
4.
Library functions
31
4.1.
31
33
ascii2hex
34
atoi
35
ator
36
atoy
37
bcd2ascii
38
bittest
39
bytetest
40
callPlugIn
41
clear_error
43
close_communication
44
datacat
46
dataclear
47
datacmp
48
datacopy
49
dataerase
50
datainsert
51
datalen
52
datarevers
53
dataset
54
doNewInit
55
enableIfhTrace
56
enableIgnitionHandling
57
enableUbattHandling
58
fclose
59
fopen
60
fread
61
freadln
62
fseek
63
3
fseekln
64
ftell
65
ftellln
66
get_battery_voltage
68
get_error
69
get_error2
70
get_ignition_voltage
71
get_trap_mask
74
generateRunError
75
getasciidate
76
getasciitime
77
getCfgString
79
getdate
80
getETXblock
81
gettickcount
84
gettime
85
hex2ascii
86
ifboot
87
ifgetport
88
ifinfo
89
ifloopt
91
ifrawmode
92
ifrecv
93
ifrequeststate
94
ifreset
95
ifsend
96
ifsetport
97
ifsireset
98
iftype
99
ifvers
100
incProgressPos
101
4
isDebugLevel
102
isSimulation
103
itoad
104
itoax
105
itor
106
make_error
108
new_set_of_results
109
open_communication
110
parcount
111
realadd
113
realdiv
115
realmul
116
realresult
117
realsub
118
recv_frequent
119
recv_keybytes
120
rtoa
121
rtoi
122
send_and_receive
123
send_frequent
124
set_answer_length
125
set_communication_pars
128
set_program_voltage
146
set_repeat_counter
147
set_trap_mask
148
set_variable_result
151
setProgressRange
152
shdataget
153
shdataset
154
stop_frequent
155
strcat
156
5
strcmp
157
strcpy
158
strcut
159
strerase
160
strinsert
161
strlen
162
strncpy
163
strrevers
164
tab2fix
165
tab_suche_index
166
tabget
169
tabline
170
tabseek
171
tabset
172
tabsetext
173
updateInfo
175
userbreak
176
var_result_data
177
var_result_long
178
var_result_real
179
var_result_string
180
wait
181
waitex
182
LIST OF REFERENCES
183
1.
Revision history
Version 5b
Version 5e
Version 5f
Version 6
Version 6a
Version 6b
Version 6d
2.
Introduction
2.2. Conventions
The following typographical conventions are used in this manual:
Example
SAMPLE.C
job, string, while
expression
[option]
{ result |
argument }
[constant...] job...
hallo="Test";
while() {
.
.}
[1]
Description
Upper case characters are used for
filenames, registers and operating system
commands.
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.
Italics designate placeholders for values to
be entered by the programmer; e.g., file
names.
Words enclosed in square brackets may be
optionally specified.
Curvy braces and vertical strokes
characterize entries from which only one
must be selected, except when in square
brackets.
An ellipsis (three dots) which directly follows
an expression indicates that several
expressions of the same type can follow.
This syntax designates examples, user
entries, program outputs and error
messages.
A column or a row comprising three dots
indicates that a section of an example was
intentionally omitted.
Reference to a document in References.
10
11
3.
Overview
To use a library function in a BEST/2 description file we simply call it in a job with the
required parameters. For example, we can write the following job in a description file:
job ( name : SAMPLE; ...)
{
char buffer[];
...
getasciidate(buffer);
.
}
This job identifies the current date by means of the getasciidate function and writes it
to the variable buffer.
3.1.2.
BEST2 uses B2RUNTIM.LIB as its default runtime library. Although this is expected to
be in the same directory as the BEST/2 compiler, another library can be specified with
the -L option when calling BEST2.
BEST2 -L \test\dev\neulib.lib test.b2v
This command line calls the BEST/2 compiler which will compile the description file
test.b2v in the current directory. It uses the library NEULIB.LIB in the \TEST\DEV
directory.
12
13
3.2.1.
Communication functions
Communication functions are used to communicate with the control unit. They provide
the facility of the interface handler contained in EDIABAS.
Function
Purpose
open_communication
close_communication
set_communication_pars
set_answer_length
send_and_receive
recv_keybytes
send_frequent
recv_frequent
stop_frequent
set_repeat_counter
14
3.2.2.
Interface functions
Interface functions are used as an interface with the functions of the diagnostic bus
interface. They provide the facility of the interface handler contained in EDIABAS.
Function
Purpose
get_battery_voltage
get_ignition_voltage
set_program_voltage
ifboot
ifreset
ifgetport
ifsetport
Sets a port
ifloopt
ifsireset
ifrequeststate
iftype
ifvers
ifrawmode
ifsend
ifrecv
ifinfo
ifinfoExt
15
3.2.3.
Function
Purpose
new_set_of_results
parcount
set_variable_result
var_result_data
var_result_long
var_result_real
var_result_string
updateInfo
setProgressRange
incProgressPos
16
3.2.4.
String functions
The string functions are used to manage and process C-compatible strings. These
strings must end with the zero character ('\0').
Function
Purpose
strcat
Catenates strings
strcut
Shortens strings
strcmp
Compares strings
strcpy
Copies strings
strncpy
strlen
strerase
strinsert
get_token
strrevers
Reverses a string
17
3.2.5.
Conversion functions
The conversion functions are used to convert data from an integer to a string form.
Function
Purpose
ascii2hex
ascii2ascii
atoi
atoy
bcd2ascii
hex2ascii
itoad
uitoad
itoax
18
3.2.6.
Real functions
Function
Purpose
itor
ator
realcomp
realadd
realsub
realmul
realdiv
realresult
rtoa
rtoi
data_to_real
real_to_data
19
3.2.7.
Data functions
Data functions move and set data. Unlike strings this data does not end on a zero.
Function
Purpose
datacat
dataclear
Clears a buffer
datacmp
datacopy
dataerase
datainsert
datalen
datarevers
dataset
shdataget
shdataset
20
3.2.8.
File functions
Function
Purpose
fopen
Opens a file
fclose
Closes a file
fread
freadln
fseek
fseekln
ftell
ftelln
21
3.2.9.
Sequence control
This function enables access in the job sequence control; i.e., when and in which
order standard jobs are called.
Function
Purpose
doNewInit
22
Function
Purpose
clear_error
get_error
get_error2
make_error
Issue an error
generateRunError
set_trap_mask
get_trap_mask
userbreak
23
Function
Purpose
gettime
getdate
getasciitime
getasciidate
gettickcount
wait
Waits n seconds
waitex
Waits n milliseconds
24
Function
Purpose
tabset
tabsetext
Tabseek
tab_suche_index
tab_suche_unsigned
Tabline
tabget
tab2fix
bittest
bytetest
25
3.2.13. Configuration
These functions are used to set and read the EDIABAS configuration.
Function
Purpose
enableIfhTrace
enableIgnitionHandling
enableUbattHandling
getCfgInt
getCfgString
isDebugLevel
isSimulation
26
Function
Purpose
AdjustKWP2000TesterPrStartComm
Adapts
the
TesterPresent
and
StartCommunication telegrams using the ECU
address in the parameters
GetKWP2000Block
getETXblock
27
4.
Clamp states
All functions of the Interface Handler which communicate with the interface are listed
below. Specification is made for each function as to which error messages are
generated based on the EDIC terminal states and which response is made to the
error message. If the UBattHandling or IgnitionHandling is disabled in
configuration file EDIABAS.INI, neither the error messages UBATT ON/OFF ERROR
(or IGNITION ON/OFF ERROR) are generated due set history bits nor is the
communicaiton aborted (and the terminal states reset) as response to this.
The system results IGNITIONCURRENT; UBATTCURRENT; IGNITIONHISTORY;
UBATTHISTORY are onlyassigned the values (0,1) for the current state of the
terminal states when at least one of the following functions is executed in the job
(except the function ifrawmode). If none of the following functions are executed in
the job, the system results above are always labeled as undefined (-1).
Function
Error messages
Response
set_communication
_pars
WRONG UBATT
UBATT ON/OFF
ERROR
IGNITION ON/OFF
ERROR
Only in case of
error:
WRONG UBATT
UBATT ON/OFF
ERROR
IGNITION ON/OFF
ERROR
Only in case of
error:
send_and_receive
Abort active
communication with
the ECU and reset
the terminal states
Abort active
communication with
the ECU and reset
the terminal states
28
WRONG UBATT
UBATT ON/OFF
ERROR
IGNITION ON/OFF
ERROR
Only in case of
error:
WRONG UBATT
UBATT ON/OFF
ERROR
IGNITION ON/OFF
ERROR
Only in case of
error:
WRONG UBATT
UBATT ON/OFF
ERROR
IGNITION ON/OFF
ERROR
Only in case of
error:
stop_frequent
None
None
get_battery_voltage
None
None
get_ignition_voltage
WRONG UBATT
None
set_program_voltag
e
None
None
recv_keybytes
send_frequent
recv_frequent
29
ifboot
None
Always:
The active
communication with
the ECU is always
aborted, and the
terminal states are
always reset.
ifreset
None
Always:
The active
communicaiton with
the ECU is always
aborted, and the
terminal states are
always reset.
ifgetport
None
None
ifsetport
None
None
ifloopt
None
None
ifsireset
None
None
ifrequeststate
None
None
ifvers
None
None
ifrawmode
None
None
30
4.
Library functions
Return value
See also
Example
Result
In the description of the arguments, (V) means that a variable must be specified, (C)
means that a constant must be specified.
This section lists all the functions of the BEST/2 runtime library in alphabetical order.
31
AdjustKWP2000TesterPrStartComm
Summary
void AdjustKWP2000TesterPrStartComm(char params[])
params
KWP 2000 parameters in the raw format for EDIC API (V)
Remarks
Return value
See also
Example
{
char parameter[];
parameter = kwp_2000_parameter;
parameter[5] = ecuAddress;
AdjustKWP2000TesterPrStartComm(parameter);
}
Result
32
ascii2ascii
Summary
Character set
String buffer(V)
This function converts all characters in the string into characters
with another ASCII code. Characters are converted according to
the passed code page..
Example
Result
...
ascii2ascii(codepage,text);
...
text = {0xE4,0xE4,0xF6,0xF6,0xFC,0xFC,0xDF,0xDF} //
33
ascii2hex
Summary
Destination buffer(V)
String buffer
Position in the destination buffer
Converts a zero-terminated string source into a sequence of
bytes and inserts these in destin beginning at byte position pos.
In this process, all characters of the string buffer are converted.
Abortion occurs in the case of invalid characters or in case of an
uneven number of characters. In the case of an error, destin
contains all converted bytes up to the erroneous character.
Result
34
atoi
Summary
Result
35
ator
Summary
Return value
See also
Example
{
real realnumber;
ator(realnumber,"1.22e01");
...
}
Result
realnumber = 12.2
36
atoy
Summary
Remarks
Return value
See also
Example
{
char ascii[];
char binary[];
ascii="aa,bb,cc,00,01"
atoy(binary,ascii);
}
Result
37
bcd2ascii
Summary
String buffer(V)
Buffer
Position in source buffer
Number of bytes to be converted
Converts a chain of bytes (two nibbles) from the source buffer
source, starting from the byte position index, into a zeroterminated BCD string destin. count nibbles are converted from
the source buffer. An '*' stands in the destination string for nibbles
with a value greater than hexadecimal 9 (A..F).
Result
destin = "34**7*"
38
bittest
Summary
Result name
Buffer to be analyzed
Test result
Remarks
You must have a table with the columns NAME, BYTE, MASK,
VALUE. Table processing must first have been set to this table
using the tabset function. The BYTE column indicates which byte
in source is to be looked at. The appropriate bits (the bits to be
looked at) must be masked in the MASK column. In the VALUE
column enter the value which the bits must have to make the
status NAME true. The result value is TRUE (1) when all the bits
set in MASK have the value specified in VALUE, otherwise it is
FALSE (0).
Return value
TRUE (1) when the result name was found in the table, otherwise
FALSE (0)
See also
bytetest
Example
table bits[4][]={
{ "NAME", "BYTE" , "MASK" , "VALUE" },
{ "XON", "0",
, "0x07" , "0x06" },
{ "XOFF", "0",
, "0x07" , "0x01" } };
{
int xonvalue; int xoffvalue;
char buffer[];
buffer[0]=0x06;
tabset("bits");
bittest("XON",buffer,xonvalue);
bittest("XOFF",buffer,xoffvalue);
}
Result
xonvalue = 1
xoffvalue = 0
39
bytetest
Summary
Result name
Buffer to be analyzed
Test result
Divider
Remarks
You must have a table with the columns NAME, BYTE, MIN,
MAX, MINDEF, MAXDEF, A, B, DIV. Table processing must first
have been set to this table using the tabset function. The BYTE
column indicates which byte in source is to be looked at. The MIN
and MAX columns indicate the lower and upper limits of the byte
in source. If the limits are breached then the value in the MINDEF
or MAXDEF columns is returned. If the value of the byte is within
the defined limits then the returned value is calculated according
to the formula A*x + B. The divider in the DIV column is returned
in div. It indicates the value by which the result has to be divided in
order to get a correct result.
Return value
0 = in valid range
1 = over range
-1 = under range
See also
bittest
Example
table bytes[3][]={
{"NAME","BYTE","MIN", "MAX", "MINDEF", "MAXDEF","A","B","DIV"},
{"TEMP","0",
"07" , "254","-40",
"120", "-4","8","1" }},
...
int tempvalue; int tempdiv; char buffer[]; buffer[0]=0x06;
tabset("bytes");
bytetest("TEMP",buffer,tempvalue,tempdiv);
}
Result
tempvalue = -40
tempdiv = 1
40
callPlugIn
Summary
Remarks
Return value
See also
linkPlugIn, callPlugInExt
Example
{
char name[];
char dataIn[];
char dataOut[];
long funcID;
long status;
...
linkPlugIn(name);
...
callPlugIn(dataOut,dataIn);
...
status = callPlugInExt(funcID,dataOut,dataIn);
...
}
Result
41
callPlugInExt
Summary
Remarks
Return value
Subfunction status
See also
linkPlugIn, callPlugIn
Example
{
char name[];
char dataIn[];
char dataOut[];
long funcID;
long status;
...
linkPlugIn(name);
...
callPlugIn(dataOut,dataIn);
...
status = callPlugInExt(funcID,dataOut,dataIn);
...
}
Result
42
clear_error
Summary
void clear_error()
Remarks
The clear_error function clears the error flag. This function must
be called when an error has been masked. It clears the entry in
EDIABAS that an error had occurred.
Return value
See also
Example
Result
set_trap_mask(0x60000);
ifreset();
set_trap_mask(0x00);
clear_error();
43
close_communication
Summary
void close_communication()
Remarks
Return value
See also
open_communication
Example
Result
44
data_to_real
Summary
Note
Return value
See also
real_to_data
Example
{
unsigned char buffer[];
real realzahl;
buffer = { 0x66, 0xe6, 0xf6, 0x42 };
data_to_real(realzahl,buffer,0,0,0);
...
}
Result
realzahl = 123.45
45
datacat
Summary
Remarks
Return value
See also
Example
Result
46
dataclear
Summary
Clears a buffer
Remarks
Return value
See also
Example
Result
47
datacmp
Summary
Remarks
The function compares the two data buffers d1 and d2. If the two
buffer have the same length and contain identical characters,
they are considered equal, otherwise unequal.
Return value
See also
Example
Result
{
int x; int y; int z;
unsigned char d1[];
d1 = {1,2,3}
x=datacmp(d1,{1,2,3});
y=datacmp(d1,{1,2,3,4});
z=datacmp(d1,{1,2,4});
}
x=0, y=1, z=1
48
datacopy
Summary
See also
Example
{
char source[]= { 0x12, 0x34, 0x56, 0x78, 0x90 };
char destin[];
datacopy(destin,source,2,3);
...
}
Result
destin={0x56,0x78,0x90}
49
dataerase
Summary
Remarks
Return value
See also
Example
{
char buffer[] = { 0x12,0x34,0xFF,0x56,0x78 };
dataerase(buffer,1,2);
...
}
Result
destin={ 0x12,0x56,0x78 }
50
datainsert
Summary
Return value
See also
Example
{
char source[] = { 0xF0,0xF1 };
char destin[] = { 0x12,0x34,0x56,0x78 };
datainsert(destin,source,3);
...
}
Result
destin={ 0x12,0x34,0x56,0xF0,0xF1,0x78 }
51
datalen
Summary
Remarks
Return value
See also
Example
Result
long length;
unsigned char buffer[];
buffer = {0x01, 0x02, 0x03, 0x04};
length = datalen(buffer);
length = 4
52
datarevers
Summary
Remarks
Return value
See also
Example
Result
53
dataset
Summary
See also
Example
{
char buffer[]={ 0x12, 0x34, 0x56, 0x78, 0x90 };
dataset(buffer,0x41,2};
...
}
Result
54
doNewInit
Summary
void doNewInit()
Remarks
Return value
See also
Example
Result
doNewInit();
55
enableIfhTrace
Summary
Remarks
Return value
See also
enableIgnitionHandling, enableUbattHandling,
getCfgInt, getCfgString, IsDebugLevel, IsSimulation
Example
Result
56
enableIgnitionHandling
Summary
Remarks
Return value
See also
Example
Result
57
enableUbattHandling
Summary
Remarks
Return value
See also
Example
Result
58
fclose
Summary
Closes a file
Result
59
fopen
Summary
Remarks
Return value
Filehandle
See also
Example
{
int handle;
handle=fopen("/usr2/test/test.dat");
...
/* file operations with handle */
...
fclose(handle);
}
Result
60
fread
Summary
Remarks
The fread function reads a character from a file. It reads from the
current position of the read pointer. The read pointer is
incremented by 1 after the character is read. If an attempt was
made to read at the end of a file, then -1 is returned as the value
of the character and the read pointer is no longer incremented.
Return value
See also
Example
{
int handle;
long c; long i=0;
handle=fopen("test.dat");
while((c=fread(handle)) != -1)
i++;
}
Result
61
freadln
Summary
Return value
See also
Example
{
int handle;
char line[]; long i=0;
handle=fopen("beispiel.txt");
while(freadln(line,handle) != -1 )
i++;
}
Result
62
fseek
Summary
Remarks
Return value
See also
Example
{
int handle;
int c;
handle=fopen("Filename");
c=fread(handle);
fseek(0,handle);
c=fread(handle);
...
}
Result
63
fseekln
Summary
Remarks
Return value
See also
Example
{
int handle;
char line;
handle=fopen("test.txt");
fseekln(10,handle);
freadln(line,handle);
...
}
Result
64
ftell
Summary
Remarks
The ftell function identifies the current position of the read pointer
in bytes from the start of a file. The position of the first character is
0. Error BIP_0006 is activated in the event of an error (failure by
EDIABAS host file system) [4].
Return value
See also
Example
{
int handle;
long c:
handle=fopen("Filename");
c=fread(handle);
c=fread(handle);
...
c=ftell(handle);
}
Result
65
ftellln
Summary
Remarks
Return value
See also
Example
{
int handle;
char line[];
handle=fopen("xxx.tst");
freadln(line,handle);
freadln(line,handle);
...
c=ftellln(handle);
}
Result
66
getasciitime
Summary
Remarks
Return value
See also
Example
{
char time[];
getasciitime(time);
...
}
Result
time="12:51:15" (example)
67
get_battery_voltage
Summary
long get_battery_voltage()
Remarks
Return value
Voltage in millivolts.
See also
get_ignition_voltage
Example
Result
long voltage;
voltage = get_battery_voltage();
68
get_error
(get_trap_mask, set_trap_mask )
Summary
Remarks
Return value
See also
Example
set_trap_mask(0xffffffff);
//trap
errors
send_and_receive(destin,source);
if(get_error(0))
job_status="FEHLER BEI SG-KOMMUNIKATION";
else
job_status="SG-KOMMUNIKATION I.O.";
Result
job_status="FEHLER
nicht antwortet.
BEI
SG-KOMMUNIKATION"
all
falls
SG
69
get_error2
Summary
Remarks
Return value
See also
Example
long error;
set_trap_mask(0xffffffff); // trap all errors
send_and_receive(destin,source);
error = get_error2();
70
get_ignition_voltage
Summary
long get_ignition_voltage()
Remarks
Return value
Voltage in millivolts.
See also
get_battery_voltage
Example
Result
long voltage;
voltage = get_ignition_voltage();
71
get_token
Summary
Remarks
Return value
See also
Example
{
char source[]; char destin[];
source="DIES IST EIN TEST FUER TOKENS";
gettoken(destin,source," ",4);
}
Result
destin = "TEST"
72
getasciidate
Summary
Note
Return value
See also
Example
{
char date[];
getasciidate(date);
...
}
Result
73
get_trap_mask
Summary
Remarks
Return value
See also
get_error, set_trap_mask
Example
Result
{
long x;
set_trap_mask(0x00180000);
x=get_trap_mask();
}
x=0x00180000
74
generateRunError
Summary
Remarks
Return value
See also
make_error, get_error
Example
{
...
generateRunError(250);
0000
}
Result
//
generate
RUN-
//
75
getasciidate
Summary
Return value
See also
Example
Result
{
char date[];
getasciidate(date);
...
}
date="FR 31.12.92 KW 52" (example)
76
getasciitime
Summary
Return value
See also
Example
Result
{
char time[];
getasciitime(time);
...
}
time="12:51:15" (example)
77
getCfgInt
Summary
Configuration element
Remarks
Return value
See also
enableIIfhTrace,
enableUbattHandling,
IsSimulation
Example
long cfgvalue;
enableIgnitionHandling,
getCfgString, IsDebugLevel,
cfgvalue=getCfgInt("RetryComm");
Result
78
getCfgString
Summary
Remarks
Return value
See also
enableIIfhTrace, enableIgnitionHandling,
enableUbattHandling, getCfgInt, IsDebugLevel, IsSimulation
Example
{
char cfgvalue[];
getCfgString(cfgvalue,"SimulationPath");
}
Result
Example: cfgvalue="c:\ediabas\sim"
79
getdate
Summary
Return value
See also
Example
getdate(date);
...
}
Result
80
getETXblock
Summary
This function filters out the data bytes of a certain block from the
response message of an ECU. In addition, the block is checked
for correctness by means of a passed status byte (expected
status == actual status). If the expected (desired) status byte
does no agree with the actual status byte, this function returns
the value 0, otherwise 1.
Return value
0 = Fehler
1 = ok
See also
Example
{
unsigned char antwort[];
unsigned char buffer[];
unsigned char status = 0xfc;
char
blockLen;
send_and_receive(antwort,tel_fslesen);
if (getETXblock(antwort,status,1,buffer,blockLen))
{
}
Result
81
GetKWP2000Block
Summary
response
format
target
KWP 2000 tester address in the 3-byte header. In a 1byte header, 0 is entered. (V)
source
length
data
Remarks
Return value
0: error
1: no error
See also
82
Example
{
unsigned char resonse[];
int position;
int format;
int source;
int target;
int length;
unsigned char data[];
unsigned char dataglobal[];
send_and_receive(resonse,request);
position = 0;
while(GetKWP2000Block(position,resonse,
format,source,target,length,data))
datacat(dataglobal,data);
}
Result
83
gettickcount
Summary
Remarks
Return value
value of milliseconds
See also
Example
{
unsigned long ticks;
ticks=gettickcount();
...
}
Result
84
gettime
Summary
Return value
See also
Example
Result
{
char time[];
gettime(time);
...
}
time= { 14,52.10 } (example)
85
hex2ascii
Summary
String buffer(V)
Source buffer
Position in source buffer
Number of nibbles to be converted
Remarks
Return value
See also
Example
{
char source[]={ 0x12, 0x34, 0xFF, 0x78, 0x90 };
char destin [];
hex2ascii(destin,source,2,5);
...
}
Result
destin = "34FF7"
86
ifboot
Summary
void ifboot()
Remarks
Return value
See also
Example
Result
ifboot();
87
ifgetport
Summary
Return value
See also
get_battery_voltage, get_ignition_voltage
Example
Result
long voltageCl30;
long jumper;
voltageCl30 = ifgetport(7);
jumper = ifgetport(8);
88
ifinfo
Summary
output
input
Remarks
Return value
See also
ifinfoExt
Example
Result
89
ifinfoExt
Summary
Function ID (V)
Output data (V)
Input data
Remarks
Return value
Status
See also
ifinfo
Example
Result
90
ifloopt
Summary
long ifloopt()
Remarks
Return value 0:
Test failed
1:
Test OK
See also
Example
Result
if(ifloopt())
/* execute diagnostic */
91
ifrawmode
Summary
Remarks
Return value
See also
Example
Result
92
ifrecv
Summary
Remarks
This function waits the specified time for characters on the serial
interface. This function is only used for the purpose of
debugging. Never use this function, since it may vary depending
on the EDIABAS version.
Return value
See also
ifsend
Example
Result
93
ifrequeststate
Summary
Remarks
Return value
See also
Example
Result
94
ifreset
Summary
void ifreset()
Remarks
Return value
See also
ifboot
Example
Result
ifreset();
95
ifsend
Summary
Remarks
Return value
See also
ifrecv
Example
Result
96
ifsetport
Summary
Sets a port
Port number
Port value
Ports can be set with this function. Only port 9 can be set in EDIC
(digital outputs).
Port 9:
Return value
See also
ifgetport
Example
Result
Digital outputs
long value;
value = 0xff;
ifsetport(9, value);
97
ifsireset
Summary
Return value
See also
Example
Result
Continuous off
Continuous on
98
iftype
Summary
Remarks
Return value
See also
ifvers
Example
Result
char typ[];
iftype(typ);
99
ifvers
Summary
long ifvers()
Remarks
Return value
Version number
See also
Example
Result
100
incProgressPos
Summary
void incProgressPos(long n)
n
Remarks
Return value
See also
setProgressRange
Example
setProgressRange(500);
incProgressPos(0); // Start with 0 percent
:
incProgressPos(100); // 20 percent processed
:
//
incProgressPos(300); // 80 percent processed
:
//
incProgressPos(200); // 100 percent processed
//
///////////////////////////////////////////////////
// In the END job
setProgressRange(0); // Reset processing state
Result
101
isDebugLevel
Summary
long isDebugLevel()
Remarks
Return value
0 = Debug AUS(default),
n = Debug- Level
See also
enableIIfhTrace, enableIgnitionHandling,
enableUbattHandling, getCfgInt, getCfgString, IsSimulation
Example
{
char antwort[];
// Output sent frame for testing purposes
if(isDebugLevel() > 3)
SEND_TEL=tel;
send_and_reveive(antwort,tel);
// Output received frame for testing purposes
if(isDebugLevel() > 3)
RECV_TEL=antwort;
}
Result
102
isSimulation
Summary
long isSimulation()
Remarks
0 = Simulation OFF(default),
1 = Simulation ON
See also
enableIIfhTrace, enableIgnitionHandling,
enableUbattHandling, getCfgInt, getCfgString, IsDebugLevel
Example
{
char antwort[];
// Use other frame for testing purposes
if(isSimulation())
send_and_reveive(antwort,tel_sim);
else
send_and_reveive(antwort,tel);
}
Result
103
itoad
Summary
Remarks
Return value
See also
Example
Result
{
char destin[];
itoad(destin,1143);
...
}
destin="1143"
104
itoax
Summary
Result
105
itor
Summary
Remarks
Return value
See also
Example
Result
{
real realzahl;
itor(realzahl,122);
...
}
realzahl = 1.22e2
106
linkPlugIn
Summary
Remarks
Return value
See also
callPlugIn, callPlugInExt
Example
{
char name[];
char dataIn[];
char dataOut[];
long funcID;
long status;
...
linkPlugIn(name);
...
callPlugIn(dataOut,dataIn);
...
status =
callPlugInExt(funcID,dataOut,dataIn);
...
}
Result
107
make_error
Summary
This function enters the trap number trapnumber in the TrapMask-Register and issues the corresponding error in the runtime
system.
Return value
See also
get_error
Example
Result
{
...
make_error(19);
}
// Issue IFH_0009
108
new_set_of_results
Summary
void new_set_of_results()
Remarks
Return value
See also
parcount, realresult
Example
...
result: ERROR_NAME ; type int ...
result: ERROR_VALUE ; type int ...
{
ERROR_NAME = NAME1;
ERROR_VALUE = 1;
new_set_of_results();
ERROR_NAME = NAME2;
ERROR_VALUE = 2;
...
}
Result
109
open_communication
Summary
void open_communication()
Remarks
This function opens the driver. This function must be called before
all other that access the interface, and it is advisable to write it as
the first function in the job INITIALISIERUNG. If
open_communication has not been called yet, then all
communication and interface commands are answered by error
message IFH_0019.
Return value
See also
close_communication
Example
Result
open_communication();
110
parcount
Summary
long parcount()
Remarks
Return value
See also
new_set_of_results, realresult
Example
Result
{
long x;
x=parcount();
}
apiJob(...,"1;2;3",...);
apiJob(...,"1",...);
apiJob(...,";;",...);
apiJob(...,"1;2;",...);
apiJobData(...,"",5,...);
=>
=>
=>
=>
=>
x=3
x=1
x=3
x=3
x=1
111
real_to_data
Summary
Remarks
Return value
See also
data_to_real
Example
{
unsigned char buffer[];
real realzahl;
realzahl = atof("123.45");
real_to_data(buffer,realzahl,0,0,0);
...
}
Result
112
realadd
Summary
Return value
See also
Example
{
real real1;
real real2;
ator(real1,"1234e15");
ator(real2,"5678e13");
realadd(real1,real2);
}
Result
real1 = 1.29078e18
real2 = 5.678e16
113
realcomp
Summary
Remarks
Return value
See also
Example
{
int cmp;
real real1;
real real2;
ator(real1,"1.00");
ator(real2,"2.00");
if (realcomp(real1,"<",real2))
cmp=1;
else
cmp=0;
}
Result
cmp = 1
114
realdiv
Summary
source
Divisor (V)
Remarks
This function divides the real variables source and destin and
writes the result to destin.
destin = destin / source
A computer overflow or underflow triggers error messages
BIP_0011.
Return value
See also
Example
{
real real1;
real real2;
ator(real1,"1234e15");
ator(real2,"5678e13");
realdiv(real1,real2);
}
Result
real1 = 21.7330045791
real2 = 5.678e16
115
realmul
Summary
Return value
See also
Example
{
real real1;
real real2;
ator(real1,"1234e15");
ator(real2,"5678e13");
realmul(real1,real2);
}
Result
real1 = 7.006652e34
real2 = 5.678e16
116
realresult
Summary
Remarks
This function generates a real result with result name name and
the value value / adjust.
Return value
See also
new_set_of_results, parcount
Example
Result
117
realsub
Summary
Return value
See also
Example
{
real real1;
real real2;
ator(real1,"1234e15");
ator(real2,"5678e13");
realsub(real1,real2);
}
Result
real1 = 1.17722e18
real2 = 5.678e16
118
recv_frequent
Summary
Remarks
If repeat send and receive (frequent mode) has been started, the
current control unit answer can be requested from the interface
with the recv_frequent function.
Return value
See also
Example
Result
119
recv_keybytes
Summary
Remarks
Return value
See also
Example
Result
120
rtoa
Summary
Return value
See also
ator
Example
{
char destin[];
real realzahl;
int len;
ator(realzahl,"1.234";
...
len=rtoa(destin,realzahl,3);
...
}
Result
destin ="1.23";
len = 5;
121
rtoi
Summary
Remarks
Return value
See also
itor
Example
{
long destin[];
real realzahl;
ator(realzahl,"5.234";
...
destin=rtoi(realzahl);
...
}
Result
destin = 5;
122
send_and_receive
Summary
Return value
See also
Example
Result
123
send_frequent
Summary
Return value
See also
Example
Result
124
set_answer_length
Summary
Telegram parameter
To send a telegram, the interface needs telegram parameters.
These parameters either control the establishment of the
connection to the control unit or transmit the information
concerning the expected response length and the response offset.
During communication with the control unit, the telegram
parameters are generally identical for all control unit telegrams.
They can be set by the user with the function set_answer_length
so that they do not have to be transmitted with each telegram.
During transmission of a telegram, the telegram parameters are
always automatically set at the beginning of the telegram. If the
user indicates no telegram parameters, the default values that
were used to set the communication parameters will be used here
as well. If only telegram parameters are to be transferred to the
interface, they must first be set with set_answer_length and then
transmitted to the interface with send_and_receive. In this case,
the telegram to be sent is empty (buffer emptied with dataclear).
telparam[0]
negative:
0x0000:
0xFFFF
telparam[1]
Command/response offset:
0x0010
0x0011
Length
Offset
-2
0
52
0
DS1,DS2(5,
6)
-1
0
Return value
See also
set_communication_pars
2.4
1
0
otherwis
e
0
0
126
Example
Result
127
set_communication_pars
Summary
Communication parameters
Remarks
long values
integer values
Concept
Concept 1
Concept 2 ISO 9141
Concept 3
=1
=2
=3
128
Concept 2 DDE
Concept DS1
Concept DS2
param[1]
=4
=5
=6
Baudrate
Evaluated with Concept 1, DS1, DS2 only
param[2]
Wakeup address
Only evaluated by the interface for Concept 2, 3 and 4 but is
needed for EDIABAS
param[3]
Wakeup
Time in ms, 0 ms means no WakeUp
(Concept 1 only)
param[4]
IdleTime
Time in ms between WakeUp and the start of the first telegram
(Concept 1 with WakeUp only)
param[5]
Timeout time
Time in ms in which the SG must have responded to a telegram
from the interface
param[6]
Regeneration time
Time in ms that must elapse after the answer from the control unit
before another telegram can be sent
param[7]
param[8]
param[9]
Checksum (optional)
Indicates how the telegram checksum must be created and
checked. If nothing is specified the checksum of the telegram to
be sent is formed automatically by the interface and the checksum
of the received telegram is formed. Checksum handling is bitcoded.
Bit 0 = 0:
Bit 0 = 1:
Bit 1 = 0:
129
Bit 1 = 1:
130
param[3]
param[4]
param[5]
param[6]
param[7]
concept
BMW-FAST = 0x10F
baud rate
0 to 115200 baud (= 115200 baud)
timeout
time in ms within which the control unit must have replied
to a telegram from the interface (= 200 ms)
regeneration time
time in ms which must pass after the control unit response
before transmission is again permitted (= 3 ms)
telegram termination time
time in ms after which a decision for telegram termination
is made (= 3 ms)
number Negative response code 0x78
maximum number of Negative response code 0x78
responses of the control unit (= 2)
timeout Negative response code 0x78
time in ms within which the control unit must have
responded after Negative response code 0x78 (= 5000
ms)
checksum (optional)
= 1 (default)
Information on how the telegram checksum is to be
calculated and checked. If nothing is indicated, the
checksum of the telegram to be transmitted is
automatically calculated by the interface and the
checksum of the received telegram is checked.
Checksum handling is bit-coded.
Bit 0 = 0:
The checksum of the telegram to be
transmitted must be calculated by the user.
Bit 0 = 1:
The checksum of the telegram to be
transmitted is calculated by the interface.
Bit 1 = 0:
The checksum of the received telegram is
checked.
Bit 1 = 1:
The checksum of the received telegram is
not checked.
131
param[1]
param[2]
param[3]
param[4]
param[5]
param[6]
param[7]
param[8]
param[9]
concept
KWP2000 BMW = 0x10C
baud rate
0 to 115200 baud (= 10400 baud)
timeout
time in ms within which the control unit must have replied
to a telegram from the interface (= 200 ms)
regeneration time
time in ms which must pass after the control unit response
before transmission is again permitted (= 3 ms)
telegram termination time
time in ms after which a decision for telegram termination
is made (= 3 ms)
time between bytes
time between bytes in ms (= 0 ms)
number Negative response code 0x78
maximum number of Negative response code 0x78
responses of the control unit (= 2)
timeout Negative response code 0x78
time in ms within which the control unit must have
responded after Negative response code 0x78 (= 5000
ms)
TesterPresent Time
time in ms between the last control unit response and the
next Tester Present telegram (= 3000 ms)
TesterPresent Telegram length
length of the TesterPresent telegram maximum 11 (= 5)
param[10] to
param[20] TesterPresent Telegram
TesterPresent telegram. If the telegram has less than 11
characters, the remaining characters must be 0.
param[21] StartCommunication Telegram length
length of the StartCommunication telegram maximum 11
(= 5)
132
param[22] to
param[32] StartCommunication Telegram
StartCommunication telegram. If the telegram has less
than 11 characters, the remaining characters must be 0.
param[33] Checksum (Optional)
= 1 (default)
Information on how the telegram checksum is to be
calculated and checked. If nothing is indicated, the
checksum of the telegram to be transmitted is
automatically calculated by the interface and the
checksum of the received telegram is checked.
Checksum handling is bit-coded.
Bit 0 = 0:
The checksum of the telegram to be
transmitted must be calculated by the user.
Bit 0 = 1:
The checksum of the telegram to be
transmitted must be calculated by the
interface.
Bit 1 = 0:
The checksum of the received telegram is
checked.
Bit 1 = 1:
The checksum of the received telegram is
not checked.
133
param[1]
param[2]
param[3]
param[4]
param[5]
param[6]
param[7]
param[8]
param[9]
Concept
KWP2000 * = 0x10D
Baud Rate
0 to 115200 baud (= 10400 baud)
Timeout
time in ms within which the control unit must have
responded to a telegram from the interface (= 200 ms)
Regeneration Time
time in ms which must pass after the control unit response
before transmission is again permitted (= 3 ms)
Telegram Termination Time
time in ms after which a decision for telegram termination
is made (= 3 ms)
Time Between Bytes
time between bytes in ms (= 0 ms)
Number Negative response code 0x78
Maximum Number of Negative response code 0x78
responses of the control unit (= 2)
Timeout Negative response code 0x78
time in ms after Negative response code 0x78 within
which the control unit must have responded (= 5000 ms)
TesterPresent Time (Optional)
time between the last control unit response and the next
Tester Present telegram in ms (= 3000 ms)
TesterPresent Telegram Length (Optional)
maximum length of the TesterPresent telegram 11 (= 6)
param[10] to
param[20] TesterPresent Telegram
TesterPresent telegram. If the telegram has less than 11
characters, the remaining characters must be 0.
param[21] Checksum (Optional)
= 1 (default)
Information on how the telegram checksum is to be
calculated and checked. If nothing is indicated, the
134
135
Concept
KWP2000 standard
= 0x10B
param[1]
param[2]
Settings
Checksum:
Bit 0:
0:
1:
Bit 1:
0:
1:
Header Format:
Bits 2 to 4 (0,1,2,3,4)
The value must be set in any case.
The parameter determines which header is used when the
header is generated by the interface.
0: CARB header
1: 1-byte header
2: 1-byte header with length byte
3: 3-byte header
4: 3-byte header with length byte
Addressing:
Bit 5:
0:
physical addressing
136
1:
functional addressing
TesterPresent Handling:
Bit 6:
0:
1:
Reserved
Bit 7
param[3]
ErrorRepeat (0 to 1000)
Number of repetitions if a communication error occurs
= 0:
param[6]
137
param[8]
0:
1:
2:
SyncMeasurement (0,1)
Only taken into account if param[7] = 0.
param[9]
0:
1:
Baud Rate
Set baud rate. Only effective if:
param[7]= 0 and SyncMeasurement = 1
or if:
param[7]<>0.
138
W0 (5 to 6550 ms)
Waiting time before the communication is initialized
(initialization according to the setting of param[7],
diagnosis start settings).
Recommended setting: 300ms
param[11]
W1 (0 to 6550 ms)
Timeout: time between the end of the 5-baud stimulation
address and the sync byte.
Recommended setting: 300ms
param[12]
W2 (0 to 6550 ms)
Timeout: time between the end of the sync byte and the
first key byte.
Recommended setting: 20ms
param[13]
W3 (0 to 6550 ms)
Timeout: time between the end of the first key byte and
the second key byte.
Recommended setting: 20ms
param[14]
param[15]
W4 (0 to 6550 ms)
Timeout: time between the inverted second key byte from
the tester and the inverted address from the control unit.
Recommended setting: 50ms
param[16]
W5 (1 to 6550 ms)
Time before the tester
communication error.
starts
stimulation
after
P1 (0 to 6550 ms)
Timeout: time between individual bytes to be respected
by the control unit within a response.
139
P2 (0 to 6550 ms)
Timeout: intermessage timeout between tester request
and control unit response or between two control unit
responses.
Recommended setting: 50ms
param[19]
P3 (0 to 6550 ms)
Time between the control unit response and the next
tester request.
P3<P2:
only with a physical request and
DataSegmentation switched off; otherwise, the tester waits
at least for P2.
Recommended setting: 55ms
param[20]
P4 (0 to 3200 ms)
Interbyte time to be respected by the tester when sending
a request.
Value 0 ... 0x7FFF: P4 in ms
Value 0x8000 ... 0xFFFF: P4 in 0.1 ms
0x8000 == 0 corresponds to no interbyte time
Recommended setting: 10ms
param[21]
param[22]
param[23]
param[36]
param[37]
141
Settings (0,1)
0:
param[50]
1:
142
0:
transmitted
without
1:
2:
DataSegmentation
Bit 3
DataSegmentation handling (only with physical addressing
of the request). With functional request addressing, all
responses will be received.
0:
1:
TesterPresent Handling
Bit 4
Setting the behavior in case of communication errors
during Tester Present
0:
1:
Recommended setting: 0
Header Generation
Bit 5
143
0:
1:
Recommended setting: 0
Baudrate Highbits
Bit 6 and bit 7
Most significant bits of the baud rate
Example:
param[51]
param[52]
Reserved
param[53]
Reserved
param[54]
Reserved
param[55]
Reserved
param[56]
Tester Address
The tester address is used if the header is generated by
the interface.
param[57]
Reserved
144
param[58]
Reserved
param[59]
Reserved
Return value
See also
set_answer_length
Example
Result
145
set_program_voltage
Summary
Remarks
Return value
See also
Example
Result
146
set_repeat_counter
Summary
Number of repeats
Remarks
Return value
See also
open_communication, close_communication,
set_communication_pars, set_answer_length,
send_and_receive, send_frequent, recv_frequent,
recv_keybytes
Example
Result
{
/* fast decision whether CU is there */
set_repeat_counter(0); // no repeat
send_and_receive(...)
/* wait till CU is there */
set_repeat_counter(10000); // 10000 repeats
send_and_receive(...)
}
147
set_trap_mask
Summary
Trap mask
The trap mask register decides which error messages will be
reported to the runtime system and which will be evaluated by the
description file. A bit is reserved in the trap mask register for some
error messages. If this bit is 0, the error is reported to the runtime
system. If it is 1 then the error can be evaluated in the description
file with get_error. set_trap_mask sets all bits of the trap mask
register with the bit pattern of the parameter mask at the same
time. The default for all bits is 0, and the original status can be
restored at any time using set_trap_mask(0).
Trap mask: Mask = 2^(Trapbit0) + 2^(Trapbit1) + ...
148
Trapbit in
Register[1]
Constant
Trapnumber for
get_error
BIT 00
---------undefined--------
--
--
BIT 01
reserved
--
--
BIT 02
0x00000004
02
BIT 03
reserved
--
--
BIT 04
reserved
--
BIT 05
reserved
--
BIT 06
BIT 07
0x00000040
06
reserved
--
--
BIT 08
reserved
--
--
BIT 09
0x00000200
09
BIT 10
0x00000400-
10
BIT 11
0x00000800
11
BIT 12
0x00001000
12
BIT 13
0x00002000
13
BIT 14
0x00004000
14
BIT 15
0x00008000
15
BIT 16
0x00010000
16
0x00020000
17
0x00030000
18
0x00040000
19
0x00100000
20
0x00200000
21
0x00300000
22
0x00400000
23
BIT 17
BIT 18
BIT 19
BIT 20
BIT 21
BIT 22
BIT 23
interface
BIT 24
0x01000000
24
BIT 25
0x02000000
25
BIT 26
0x04000000
26
BIT 27
reserved
--
--
BIT 28-31
reserved
--
--
Table 1:
Return value
See also
get_error, get_trap_mask
Example
Result
{
set_trap_mask(0x00180000);
send_and_receive(.....);
if(get_error(19))
job_status="DIAGNOSE-FEHLER";
else
job_status="OKAY";
}
job_status = "DIAGNOSE-FEHLER"; // if CU does not answer.
150
set_variable_result
Summary
longRslt
realRslt
stringRslt
dataRslt
Remarks
Return value
See also
Example
{
char wert[]="My result value";
unsigned char y[];
real x;
set_variable_result("ERGEBNIS",3,0,x,wert,y);
}
Result
Corresponds to
151
setProgressRange
Summary
Return value
See also
incProgressPos
Example
setProgressRange(500);
incProgressPos(0); // Start with 0 percent
:
incProgressPos(100); // 20 percent
// processed
:
incProgressPos(300); // 80 percent
// processed
:
incProgressPos(200); // 100 percent
// processed
///////////////////////////////////////////////////
// Im ENDE-Job
setProgressRange(0); // Reset
// processing mode
Result
152
shdataget
Summary
Remarks
This function copies the entire contents of the global data memory
into the destination buffer. The destination buffer is cleared prior
to copying the contents. The ID (name) of the data memory is an
Asciiz string (C-string) which has a maximum of 32 characters.
Even an empty string is a valid ID. If an empty string is used as
ID, the contents of the data memory are always copied into the
destination buffer. Otherwise only the data memory is copied
when the same ID has been used for the filling.
Return value
TRUE (1) if the global data memory has been found and the
contents have been copied.
FALSE (0) if the global data memory has not been found and the
contents have not been copied.
See also
shdataset
Example
Result
153
shdataset
Summary
Fills the global data memory with the contents of the source
buffer.
Remarks
Return value
See also
shdataget
Example
Result
154
stop_frequent
Summary
void stop_frequent()
Remarks
Return value
See also
send_frequent, recv_frequent
Example
Result
155
strcat
Summary
Remarks
The strcat function appends the string source to the existing zeroterminated string destin. Only so many characters are appended
so that destin including the zero character can fit in a string
register, i.e. 1023 characters max. Both strings can have the
length 0. The source string is not changed.
Return value
See also
Example
{
char destin[]="01234";
char source[]="56789";
strcat(destin,source);
}
Result
destin="0123456789" , source="56789"
156
strcmp
Summary
String1 (V)
String2 (V)
Remarks
This function compares the two strings s1 and s2. If both strings
are the same length and identical in all characters, then the
system decides they are equal, otherwise not equal.
Return value
See also
Example
{
int x; int y; int z;
char s1[]="ABC";
x=strcmp(s1,"ABC");
y=strcmp(s1,"ABCD");
z=strcmp(s1,"abc");
}
Result
157
strcpy
Summary
Copies a string
Remarks
Return value
See also
Example
Result
{
char destin[]="ABC";
strcpy(destin,"XD");
}
destin= "XD"
158
strcut
Summary
Shortens a string
Remarks
Return value
See also
Example
Result
{
char buffer[]="ABCDF";
strcut(buffer,3);
}
buffer= "AB"
159
strerase
Summary
Remarks
Return value
See also
Example
Result
{
char buffer[]="ABCDEFGHIJKLM";
strerase(buffer,3,3);
}
buffer= "ABCGHIJKLM"
160
strinsert
Summary
String to be edited
String to be inserted
Position from which characters are to be inserted
Remarks
strinsert inserts the string source into the string destin. The
characters are inserted from position pos. If the string destin is
longer than a string register, i.e. 1024 characters, the rest is cut
off.
Return value
See also
Example
Result
{
char buffer[]="ABCGHIJKLM";
strinsert(buffer,"DEF",3);
}
buffer= "ABCDEFGHIJKLM"
161
strlen
Summary
Remarks
Return value
See also
Example
Result
{
char string[]="ABCDEF"
long x;
x=strlen(string);
}
x=6
162
strncpy
Summary
Remarks
Return value
See also
Example
Result
{
char destin[]="ABCDEFGH";
strncpy(destin,"XYZABCDEF",3);
}
destin= "XYZDEFGH"
163
strrevers
Summary
Reverses a string
String to be reversed
Remarks
strrevers turns the string round, i.e. the last character become the
first and so on.
Return value
See also
Example
Result
{
char destin[]="ABCDEFGH";
strreverse(destin);
}
destin= "HGFEDCBA"
164
tab2fix
Summary
Reads the values from the current table line and converts them
into a number
Remarks
The function tab2fix reads a value from the current table line
defined with tabseek or tab_suche_index and converts it into a
number. The text of spalte indicates from which column the value
must be taken. If the column does not exist the error BIP_0010
(constant data access error)[4] is returned.
Return value
See also
Example
Result
165
tab_suche_index
Summary
Remarks
Return value
See also
Example
Result
table TEST[3][]={
{ "NAME", "VALUE", "NUMBER" },
{ "ONE", "1000", "0X00"
},
{ "TWO", "2000", "0X03"
},
}
{
char buffer[];
tabset("TEST");
tab_suche_index("NUMBER",3);
tabget(buffer,"NAME");
}
buffer = "THREE"
166
tab_suche_unsigned
Summary
value
Remarks
Return value
See also
167
Example
table TST[3][]={
{ "NAME", "WERT", "NUMMER" },
{ "A",
"0",
"0x0000" },
{ "B",
"768", "0x0300" }
}
{
char buffer[];
unsigned long index;
tabset("TST");
index=0x300;
tab_suche_unsigned("NUMMER",index);
tabget(buffer,"NAME");
}
Result
buffer = "B"
168
tabget
Summary
Remarks
tabget reads a value from the current table line defined with
tabseek or tab_suche_index. The value of column indicates from
which column value must be taken. If the column does not exist
the error BIP_0010 (constant data access error)[4] is returned.
Return value
See also
Example
see tabset
Result
169
tabline
Summary
Remarks
tabline positions the read pointer on the specified line. The first
line is numbered 0. If there is a line which the number matches,
the function return TRUE (!0), otherwise FALSE (0). If there is no
line which the number matches, the pointer is on the last line in
the table (important for default values). The elements of this line
can now be read using tabget.
Return value
See also
Example
see tabseek
Result
170
tabseek
Summary
Remarks
The function tabseek searches for the string value in the column
column. The search always begins with the second table line. If
the search is successful the function returns TRUE (!0), otherwise
FALSE (0). If the value is found, then the read pointer for the table
is on the line with the found value, if not it is on the last line in the
table (important for default values). The elements of this line can
now be read using tabget. If the column does not exist the error
BIP_0010 (constant data access error)[4] is returned.
Return value
See also
Example
see tabset
Result
171
tabset
Summary
Result
172
tabsetext
Summary
tabname
Remarks
Return value
See also
Example
tabsetext("file","TST"); // file.prg/grp
Result
173
uitoad
Summary
Remarks
Return value
See also
Example
{
char destin[];
uitoad(destin,4294967295);
...
}
Result
destin="4294967295"
174
updateInfo
Summary
void updateInfo()
Remarks
Return value
See also
Example
Result
updateinfo();
175
userbreak
Summary
void userbreak()
Remarks
Return value
See also
make_error
Example
Result
userbreak();
176
var_result_data
Summary
Remarks
The function produces a data result with the result name name
and the value value. The result name name is determined first at
runtime.
Return value
See also
Example
{
char resultname[] = "X";
char resultvalue[] = { 0x12, 0x34, 0xFF };
var_result_data(resultname,resultvalue);
}
Result
177
var_result_long
Summary
Remarks
The function produces a long result with the result name name
and the value value. The result name name is determined first at
runtime.
Return value
See also
Example
{
char resultname[] = "X";
long resultvalue = 0x10;
var_result_long(resultname,resultvalue);
}
Result
178
var_result_real
Summary
Remarks
The function produces a real result with the result name name
and the value value. The result name name is determined first at
runtime.
Return value
See also
Example
{
char resultname[] = "X";
real resultvalue;
ator(resultvalue,"1.23");
var_result_real(resultname,resultvalue);
}
Result
179
var_result_string
Summary
Remarks
The function produces a string result with the result name name
and the value value. The result name name is determined first at
runtime.
Return value
See also
Example
{
char resultname[] = "X";
char resultvalue[] = "ABC";
var_result_string(resultname,resultvalue);
}
Result
180
wait
Summary
Wait n seconds
Remarks
The wait function waits time second. wait waits for a maximum of
time seconds and a minimum of time-1 seconds. If time = 0, there
is no waiting.
Return value
See also
Example
Result
{
wait(1);
}
waits 1 second
181
waitex
Summary
Waits n milliseconds
void waitex(unsigned long time)
time
Remarks
Return value
TRUE
end
FALSEcounter overrun
See also
gettickcount,
getdate
Example
{
waitex(1000);
}
Result
waits 1 second
of
getasciidate,
waiting
getasciitime,
time
getdate,
182
LIST OF REFERENCES
[1]
[2]
[3]
[4]
183