23.03.2017 Views

wilamowski-b-m-irwin-j-d-industrial-communication-systems-2011

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LIN-Bus 45-11<br />

The successful_transfer status is set when a frame has been successfully transferred by the slave, that<br />

is, a frame has either been received or transmitted.<br />

45.7 transport Layer Protocol<br />

The LIN transport layer provides a data transfer between master and slave node for diagnostic, slave node<br />

configuration, and identification purposes. It achieves segmentation/desegmentation and flow control. The<br />

diagnostics message transfer is compatible with CAN-based diagnostic protocols. Typically diagnostics<br />

are performed from a tester where a LIN master can pass the received tester requests to the relevant LIN<br />

slaves. A LIN slave receives requests, routes them to the appropriate service, and constructs the response.<br />

LIN version 2.0 defines a transport layer protocol that was deduced from the ISO 15765-2 protocol<br />

[ISO15765-2]. It tunnels Keyword Protocol 2000 (KWP-2000) and Unified Diagnostic Services (UDS),<br />

as defined in ISO 15765-2 and ISO 14229-1 [ISO14229-1], and provides the configuration and diagnostic<br />

service for LIN slaves. Therefore, the full transport layer specification does not have to be implemented<br />

in all slave nodes; LIN version 2.1 specifies three diagnostic classes as:<br />

Class 1 supports single frame transport protocol only, with fault indication by signals.<br />

Class 2 provides node identification support, implementing the multi-frame transport protocol,<br />

but supporting only the UDS/KWP-2000 “read by identifier” service.<br />

Class 3 slave nodes are the most complex nodes. They execute additional tasks beyond the basic<br />

sensor and support the services: diagnostic session control, input/output control, read/clear<br />

diagnostic trouble code information, as well as optional flash programming features.<br />

The transport layer protocol uses two diagnostic frames: the MRF and the SRF. The MRF (ID = 0x3C)<br />

is the diagnostic request, where the master transmits both the frame header and the frame response to<br />

a slave node. The SRF (ID = 0x3D) represents the diagnostic response, where the master transmits the<br />

header, and a slave transmits the response to the master that contains the answer of the preceding MRF.<br />

The protocol uses single frames (SF), but for multi-frame support, first frames (FF) and consecutive<br />

frames (CF) are mapped into the eight data bytes of a LIN frame. A MRF is always transmitted to all<br />

slave nodes (broadcast traffic). Therefore, the slave node address, the so-called node address for diagnostics<br />

(NAD) is stored in the first data byte. The second data byte stores the protocol control information<br />

(PCI) of the transport layer and the third data byte stores the service identifier (SID) defined in the<br />

standards ISO 15765-3 (KWP-2000) [ISO15765-3] and ISO 14229-1 (UDS) [ISO14229-1].<br />

A simple example for use of a single frame transport protocol is the node configuration service<br />

“assign NAD” (see Figure 45.10). With this service, the slave nodes in a cluster can assign a unique NAD.<br />

Master<br />

Slave<br />

ID = 0×3C<br />

Initial<br />

NAD<br />

PCI<br />

0×06<br />

SID<br />

0×B0<br />

D1<br />

Supplier ID<br />

LSB<br />

D2<br />

Supplier ID<br />

MSB<br />

D3<br />

Function ID<br />

LSB<br />

D4<br />

Function ID<br />

MSB<br />

D5<br />

new NAD<br />

MRF<br />

assign NAD<br />

request<br />

ID = 0×3D<br />

Initial<br />

NAD<br />

PCI<br />

0×01<br />

RSID<br />

0×F0<br />

D1<br />

0×FF<br />

D2<br />

0×FF<br />

D3<br />

0×FF<br />

D4<br />

0×FF<br />

D5<br />

0×FF<br />

SRF<br />

positive<br />

assign NAD<br />

response<br />

FIGURE 45.10<br />

The “assign NAD” service as an example for a single frame.<br />

© <strong>2011</strong> by Taylor and Francis Group, LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!