Documentation search search close
CONTENTS
https://www.speedgoat.com/help/slrt/page/icon_documentation.jpg
v10.0.1.x for R2026a
View other versions

IO611 - LIN Slave Read

IO611 - LIN Slave Read — Read messages from the LIN channel

Library

Simulink Real-Time - Speedgoat

Description

Read messages from the LIN channel.

Ports

All the input and output ports of this block are vectors with as many elements as messages are configured to be read. Except the number of elements of the data output port is 8 times the number of configured messages.

The input ports of this driver block are used to filter incoming messages. Note that the Checksum can be changed at runtime, whereas the Message IDs cannot.

The outputs will always show the last received message that complies with the relevant filter configured with the inputs.

Inputs
Prot.ID

Message ID for the message filter

Data Types:uint8

Checksum

Checksum for the message filter

Data Types:uint8

Data Len

Data length for the message filter

Data Types:uint8

Outputs
Prot.ID

The LIN identifier received. Range 0 to 63. Parity P0 and P1 are removed by the driver.

If an Error message has been received (See output "Msg Type" below), this output will contain the error code. The following error codes are possible:

  • 0: no error

  • 1: bit error

  • 2: checksum error

  • 3: parity error

  • 4: no answer from slave

  • 5: Sync break error

  • 6: Inconsistent sync break field

  • 7: More data expected

  • 8: Timeout after start of sync break field

  • 9: Timeout after sync break field

  • 10: Timeout after sync field

  • 11: Slave didn't start

  • 12: LIN parameter error

Data Types:uint32

Msg Type

This port can take three possible values:

  • 0: Dataframe message

  • 2: Error message

  • 3: Wakeup message

If the message type is "Error message", the error code is written to the "Prot.ID" output. The error codes are listed above.

Data Types:uint32

Checksum

Checksum version used in the received message:

  • 0: Classic Checksum (LIN 1.1, LIN 1.2, LIN 1.3)

  • 1: Enhanced Checksum (LIN 2.0, LIN 2.1, LIN 2.2)

Data Types:uint32

Data Len

Data length code (DLC) of the received message. Range 0 to 8

Data Types:uint32

Data Overrun

State of the received message queue.

  • 0 if normal operation

  • 1 if the buffer is overrun

Data Types:uint32

Timestamp

The timestamp for receipt of the LIN message. The resolution is 1µs, so in order to get a double value in seconds, the block output must be converted to double and multiplied by 1e-6. This 1µs resolution is given by the hardware implementation of the IO61X modules. The time is reset to zero at each model start.

Data Types:uint32

Data

The message data. The LIN protocol allows for messages with up to eight data bytes. If N messages filtered for, this vector will simply be sized N * 8.

Data Types:uint8

Parameters

Module ID

Specifies the ID of the IO61X module this driver block should be connected to. It must correspond to the module ID of the according setup block. Check the setup block help for more details.

Sample Time

Defines the base sample time at which this driver block gets its sample hit. It can also be set to -1 for inherited sample time. The units are in seconds.

Read Message from Channel

Choose the LIN channel to which this driver block should be connected.

Number of LIN Messages

This field configures how many LIN messages to filter for. This parameter directly sets the input and output port widths. Range is between 1 and 50.