CCS Standardfunction   ComBlock [Str]
 

ComBlock [Str]

Interface_Protocol_Block [Str]

Bytes_Expected_Back [INT]

Timeout [s]

Mode [c/Init/l/s]

Description of Function

Sends an interface protocol block from the tester via the serial interface to the control unit. Depending on the mode, a response (measured data block) may be expected from the control unit; the response is written to a received data memory. The function ComBlock can be used in conjunction with the functions K2000Ini, CAN2000Ini, as well as the general function ComInit. That received data memory can be accessed by means of the functions BlockInt IDH_BlockInt and BlockStr IDH_BlockStr . Evaluation of tolerances within the ComBlock function is not permissible.

Testing Points

None

Parameters

Interface_Protocol_Block

Specifies the protocol block that is to be sent to the control unit in the form of a sequence of bytes. Each byte is represented by 2 hexadecimal digits. There must be no spaces or any other separators between the bytes. The limitation to 14 ASCII characters does not apply in this case. Depending on the protocol, individual bytes of the protocol frame may also have to be included (see Notes on Diagnostic Protocols Diagnose-Protokolle ).

If a block that does not require a request block is to be read by the tester, no parameter is specified at this point (e.g. control unit automatically sends a block to the tester after a reset without a request having been issued).

Bytes_Expected_Back

Number of bytes expected back and written to the received data memory in the case of a test read function; depending on the protocol (see Notes on Diagnostic Protocols Diagnose-Protokolle ), some of the protocol frame bytes may also be counted; in the case of KWP2000 and EASY, this parameter is not analyzed. For mode 's' or 'c' (see testing parameter 'Mode'), 0 is entered here.

Timeout

If the test read function receives no response from the control unit within the period specified for the timeout, the test is aborted. For mode 's' or 'c' (see testing parameter 'Mode'), 0 is entered here.


Standard value: 1s

Mode

The parameter 'Mode' has the following meanings for the function ComBlock:
´l´ : Read function: function returns measured value(s).
´s´:Control function; no response is expected.

´Init´: Initialization function; corresponds to Mode 's' except that the tester remains ready to receive and can receive messages which can be retrieved by means of a ComBlock call using Mode 'l'.

´c´:Continuous function; indicates that the interface protocol block is incomplete and is continued on a succeeding line.

Example 1: Reading measured data block (K71)

ComBlock

03001203,65,1,l


Interface protocol block (Bytes 1 - 4):

03: Block length
00: Block count
12: Block title"Read measured data"
03: End of Text

Example 2: Reading RAM (K71)

ComBlock

06000102FCAB03,2,1,l


Interface protocol block (Bytes 1 - 7):

06: Block length
00: Block count
01: Block title"Read RAM"
02: Number of cells
FC: H-byte start address
0B: L-byte start address
03: End of Text

Example 3: Write to EEPROM

ComBlock

08001A02B100112203,0,0,c


Interface protocol block (Bytes 1 - 9):

08: Block length
00: Block count
1A: Block title"Write to EEPROM (serial)"
02: Number of cells
B1: H-byte start address
00: L-byte start address
11: Contents of first EEPROM cell
22: Contents of second EEPROM cell
03: End of Text

1 Notes on Diagnostic Protocols

The interface protocol block is not dependent on the tester used. However, it may have to include checksums and details of the length of the protocol block; as it is time-consuming for the author of the PAV to have to determine and correctly enter such data, with some protocols it is automatically completed by the testing station control software or the tester before the interface protocol block is sent to the control unit.

Below are details of which useful data has to be specified in the test function according to the diagnostic protocol in the interface protocol block and at which location the useful bytes are to be found in the received message (in the received messages memory).

KW2000 KW2000

KW71 KW71

KW82 KW82

EASY EASY

2 KW2000

A message that is sent to the control unit is constructed as follows:

<= 63 useful bytes

Meaning

Position in interface protocol block

Byte 1

80h + Number of useful bytes

-

Byte 2

01h

-

Byte 3

F1h

-

Byte 4..n

Useful bytes

1 .. (n - 3)

Byte n+1

Checksum

> 63 useful bytes

Meaning

Position in interface protocol block

Byte 1

80h

-

Byte 2

01h or control unit address

-

Byte 3

F1h

-

Byte 4

Number of useful bytes

-

Byte 5..n

Useful bytes

1 .. (n - 3)

Byte n+1

Checksum

Only the useful bytes (Byte 4 .. n or Byte 5 .. n) are entered in the PAV; when the program is run, the complete message is generated from them and sent (by a tester) to the control unit.

A message that is received by the control unit is constructed as follows:

Meaning

Position in received messages memory

Byte 1

80h + Number of useful bytes + 1

-

Byte 2

F1h

-

Byte 3

01h

-

Byte 4

Response byte

1

Byte 5..n

Useful bytes

2 .. (n - 3)

Byte n+1

Checksum

n - 2

The first 3 bytes are automatically removed from the message received; the message is then written to the received data buffer; when accessing the data using the testing function BlockInt IDH_BlockInt or BlockStr IDH_BlockStr , Index 1 thus refers to the response byte, and Index 2 to the first useful byte.

The response byte should be checked in the PAV for every ComBlock read function.

KW71

A message that is sent to or received from the control unit is constructed as follows:

Meaning

Position in interface protocol block

Position in received messages memory

Byte 1

Block length

1

1

Byte 2

Block counter

2

2

Byte 3

Block title

3

3

Byte 4..n

Useful bytes

4 .. n

4 .. n

Byte n+1

ETX

All bytes apart from ETX are entered in the PAV. When the program is run, ETX is automatically appended to the message and sent (by a tester) to the control unit.

When a message is received by the control unit, the entire message is written to the received data buffer; when accessing the data using the testing function BlockInt IDH_BlockInt or BlockStr IDH_BlockStr , Index 4 thus refers to the first useful byte.

KW82

A message that is sent to or received from the control unit is constructed as follows:

Meaning

Position in interface protocol block

Position in received messages memory

Byte 1

Block length

1

1

Byte 2

Block title

2

2

Byte 3..n

Useful bytes

3 .. n

3 .. n

Byte n+1

Checksum

All bytes apart from Checksum are entered in the PAV. When the program is run, the checksum is automatically appended to the message and sent (by a tester) to the control unit.

When a message is received by the control unit, the entire message is written to the received data buffer; when accessing the data using the testing function BlockInt IDH_BlockInt or BlockStr IDH_BlockStr , Index 3 thus refers to the first useful byte.

EASY

With regard to the bytes to be specified or the response bytes, messages in the EASY protocol are treated in the same way as with KW82 KW82 .


1. Diagnosis Protocolls

2. KW2000