Advanced Frame Types

NI-CAN

Advanced Frame Types

The LIN 2.0 Specification further classifies LIN frames into six types (unconditional, event triggered, sporadic, diagnostic, user-defined, and reserved). It is important to note that the differences in these frame types are due to either the timing of how they are transmitted or the content of the data bytes. Regardless of frame classification, a full LIN frame always consists of a header transmitted by the master task and a response transmitted by a slave task. The NI-CAN Frame API for LIN can address the needs of handling each of these LIN-specified frame types.

The unconditional frame type is most commonly used. Unconditional frames carry signals (data) and their identifiers are in the range of 0–59. The event triggered frame type attempts to conserve bus bandwidth by requesting an unconditional frame response from multiple slaves within one frame slot time.

The event triggered frame may have an ID in the range of 0–59. Each slave that could potentially respond to the event triggered header ID has its first data byte loaded with the protected ID it would respond to if the master was querying it for an unconditional frame. The event triggered frame works as follows. The master writes an event triggered ID in a header. The slaves may only respond to the event triggered ID if their data has been updated. If only one slave publishes a response, then the master receives it and looking at the first data byte, knows from which slave (through the protected ID), it was received. If multiple slaves publish a response then a collision will occur, which the master device slave task will report as a bus error. The master device will then query a response from each slave using unconditional frames.

Sporadic frames attempt to provide some dynamic behavior to the LIN. Sporadic frames always carry signals (data) and their IDs are in the range of 0–59. The header of a sporadic frame should only be sent in it frame slot when the master task know that a data value (signal) within the frame has been updated. This requirement makes the master device slave task the normal publisher of sporadic frame responses.

Diagnostic frames are always eight data bytes in length, and always carry diagnostic or configuration data. Their ID is either 60 for a master request frame, or 61 for a slave response frame. User defined frames have an ID of 62 and may carry any type of information. Reserved frames have an ID of 63 and must not be used in a LIN 2.0 cluster.