LIN2.1

The LIN is a serial communications protocol which efficiently supports the control of
mechatronics nodes in distributed automotive applications.

mechatronics [ˌmekəˈtrɑːnɪks] 机电一体化;机械电子学

在这里插入图片描述

A cluster consists of one master task and several slave tasks. A master node contains
the master task as well as a slave task. All other slave nodes contain a slave task
only. A node may participate in more than one cluster. The term node relates to a single
bus interface of a node if the node has multiple bus interfaces. A sample cluster
with one master node and two slave nodes is depicted below:
在这里插入图片描述

The master task decides when and which frame shall be transferred on the bus. The
slave tasks provide the data transported by each frame.

Frames
A frame consists of a header (provided by the master task) and a response (providedby a slave task).
The header consists of a break field同步间隔场 and sync field同步场 followed by a frame identifier标志符场. The frame identifier uniquely defines the purpose of the frame.
The slave task appointed for providing the response associated with the frame identifier transmits it, as depicted below. The response consists of a data field and a checksum field.
The slave tasks interested in the data associated with the frame identifier receives the response, verifies the checksum and uses the data transported
在这里插入图片描述

This results in the following desired features:
• System flexibility: Nodes can be added to the LIN cluster without requiring
hardware or software changes in other slave nodes.
• Message routing: The content of a message is defined by the frame identifier
(similar to CAN).
• Multicast: Any number of nodes can simultaneously receive and act upon a
single frame.

Data transport
Two types of data may be transported in a frame; signals or diagnostic messages.
Signals
Signals are scalar values or byte arrays that are packed into the data field of a frame.
A signal is always present at the same position of the data field for all frames with the same frame identifier.
Diagnostic messages
Diagnostic messages are transported in frames with two reserved frame identifiers.
The interpretation of the data field depends on the data field itself as well as the state of the communicating nodes.

Schedule table
The master task (in the master node) transmits headers based on a schedule table.
The schedule table specifies the frames and the interval between the start of a frame and the start of the following frame. The master application may use different schedule tables and select among them.

SIGNAL MANAGEMENT
A signal is transported in the data field of a frame.
SIGNAL TYPES
A signal is either a scalar value or a byte array. A scalar signal is between 1 and 16 bits long. A one bit scalar signal is called a boolean signal. Scalar signals in the size of 2 to 16 bits are treated as unsigned integers. A byte array is an array of between one and eight bytes. Each signal has exactly one publisher, i.e. it is always written by the same node in the cluster. Zero, one or multiple nodes may subscribe to the signal. All signals have initial values. The initial value for a published signal is valid until the node writes a new value to this signal. The initial value for a subscribed.