Beijer Electronics SCOM Protocol EN User Manual

Page 14

Advertising
background image

Message Format and Description

14

Elektronik-Systeme Lauer, MAEN976

As shown in the table, the DATA field is optional, if the used command does not re-
quire any data. In this case the value of LEN is 0 and the minimum size of a SCOM
message 7 bytes (bytes 0 to 6), because field ICHKD is not sent.

If a command requires data to be sent, the maximum size of a SCOM message is 82
bytes
. This means, that the last field ICHKD is located at the offset of the first data
byte plus the value of the LEN field.

The maximum value of the LEN field is 74, which is calculated as:

[LEN] = max. message size - (min. message size + ICHKD size)

or

82 - (7 + 1) = 74

5

LEN

0 to 74
(0x00 to 0x4A)

1 byte

The size of the DATA-field in bytes.

6

ICHKH ...

1 byte

To protect the message header
(bytes 0 to 5), a simple 8-bit checksum is
calculated as follows:
1.
2.

3.

Calculate the sum of bytes 0 to 5.
Reduce the sum width to 8 bits
(AND 0xFF).
Invert all bits. The result is ICHKH.

The checksum is verified as follows:
1.
2.

3.

Calculate the sum of bytes 0 to 6.
Reduce the sum width to 8 bits (AND
0xFF).
The result should be 0xFF.

7

...

DATA ...

0 to 74
bytes

Optional field.
If the LEN-field is not 0, this field contains
sub-commands and/or data for the
specified command. If the LEN-field is 0,
no data is available.

7 + [LEN] ICHKD ...

1 byte

Optional field. Only sent if data is
available (LEN

≠ 0).

To protect the data (bytes 7 to 7+(LEN-1)),
a simple 8-bit checksum is calculated as
follows:
1.

2.

3.

Calculate the sum of bytes 7 to
7+(LEN-1)
Reduce the sum width to 8 bits (AND
0xFF)
Invert all bits. The result is ICHKD.
The checksum is verified as follows:

1.
2.

3.

Calculate the sum of bytes 7 to 7+LEN
Reduce the sum width to 8 bits (AND
0xFF)
The result should be 0xFF

82 bytes

Byte

Field

Value

Size

Description

Advertising