Message Structure

<< Click to Display Table of Contents >>

Navigation:  Protocols > LIN-Bus Basics >

Message Structure

 

A LIN message is received by all bus participants. Whether the received message is relevant for an individual receiver is decided using message IDs. A function for addressing individual nodes does not exist.

 

Sending of a message is always initiated by the master. Each LIN ID is assigned to exactly one replying slave. This becomes clear considering the structure of a LIN message. The exception is the “event-triggered frame”, to which several slaves can respond. This special message form was introduced with the latest LIN standard.

 

Messages are divided into two parts: message header (header) and the actual data including a checksum. The header contains the message ID. This part of the message is always written on the bus by the master. All Slaves read the header and check whether they are required to deliver data. The corresponding slave writes the requested data directly behind the header on the bus. All other bus participants remain passive and do not reply to the received message ID. However, all participants who are connected to the bus receive the message, enabling a slave-to-slave communication initiated by the master.

 

LIN_Botschaft

 

 

In the above figure, the part of the message marked in blue is sent by the LIN master, the yellow part is likewise added by a LIN slave.

 

Message parts:

 

Synch break: Sign for the slaves that a transmission will follow (length depending on LIN standard).
 

Synch field: Synchronization byte to which the slaves adjust their own speed. (1 byte).
 

Identifier: Message ID (1 byte).
 

Data fields: Data to be transmitted (0-8 byte).
 

Checksum: Checksum for detecting transfer errors (1 byte).

 

 

The following message types are differentiated:

 

Unconditional frame
Standard message on the LIN bus, for transport of signals.
 

Sporadic frame
Special form of “unconditional frame” that will not be cyclically transmitted unless in case of a value change.

 

Event-triggered frame
Message with a special status permitting a response of several slaves on the same message ID. A slave to whom a message of this type is assigned will only respond if its data has changed. In optimal cases, only one slave will respond to these message IDs. If several slaves respond, a collision on the bus results. The LIN master recognizes this and requests the slaves’ data with separate messages.

 

Diagnostic frame
Message with message IDs 0x3C or 0x3D, used to transmit the LIN transport protocol. No data can be transmitted using these message IDs.

 

Reserved frame
Message IDs which should not be used (0x3E and 0x3F).

 

Identifier

Basis for all communication on the LIN bus are the identifiers of the individual messages. The participants or ECUs connected to the bus are not addressed directly. Instead, every bus participant receives all messages on the bus. Message IDs determine whether a message is processed. For every identifier, there can be several receivers, but normally there is only one sender. The exception is the “event-triggered frame”: Several slaves can reply to these messages.

The message identifier has a length of six bits and can thus accept values of 0x00 to 0x3F. This enables a maximum of 64 message IDs on the bus.

 

Data

A LIN message can transport a maximum of 8 bytes of data. The bytes can be arbitrarily used. Exceptions are applications like “event-triggered frame” or “diagnostic frame”. In case of an “event-triggered frame”, the first byte of data is used as a multiplex value, identifying the slave which has written the data on the bus. The “diagnostic frames” belong to a transport protocol that is described in detail in the LIN specification.

 

Checksum

Each message comes with a checksum. The checksum is one byte long and differs from LIN version 1.3 to LIN version 2.1:

 

LIN V1.3 (classic checksum): The checksum is calculated from the data-bytes only.
 

LIN V2.1 (enhanced checksum): The checksum is calculated from both the data and PID field.

 

Inside a LIN V2.1 bus, individual messages can also be transmitted as LIN V1.3 messages, in order to remain compatible with old ECUs.

 

The message IDs 60 (0x3C) and 61 (0x3D) are reserved for the classic checksum as per LIN 1.3.