Working with the block library RITM CAN FD
Library Blocks RITM CAN FD They are designed to configure the CAN FD interfaces, transmit and receive CAN and CAN FD frames, restart the interface and read the status of the controller.
To work with blocks, install or update the RITM Block support package by following these steps command in script editor
or command line
:
engee.package.install("RITM-Engee-Blocks")
The path to the library: /RITM/RITM CAN FD.
The library includes the following blocks:
CAN bus for FD messages
Blocks RITM-CANFD TX and RITM-CANFD RX They use a tire CAN_FD_MESSAGE_BUS of the following type:
BusSignal{(:ProtocolMode, :Extended, :Length, :Remote, :Error, :BRS, :ESI, :DLC, :ID, :Reserved, :Timestamp, :Data), Tuple{UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt32, UInt32, Float64, UInt8}, ((), (), (), (), (), (), (), (), (), (), (), (64,)), :CAN_FD_MESSAGE_BUS}
The type describes a single CAN FD message. Ports of Messages blocks RITM-CANFD TX and RITM-CANFD RX they transmit an array of tires CAN_FD_MESSAGE_BUS; its length is set by the parameter Максимальное число сообщений:. The fields of each element of the array have the scalar types given below, and Data It is an array of 64 bytes.
Bus Fields:
| Field | Type | Description |
|---|---|---|
|
|
Frame format: |
|
|
ID format: |
|
|
The number of significant bytes in the field |
|
|
The RTR flag. Let’s say only for a classic CAN frame. |
|
|
Indicates an error frame. |
|
|
Switching to data phase rate: |
|
|
Error State Indicator of the CAN FD frame. It is allowed only for CAN FD. |
|
|
The code of the length of the received frame. When transmitting CAN FD, the actual DLC is determined by the field |
|
|
The frame ID. Maximum value — |
|
|
Reserved. When forming the frame, set |
|
|
The timestamp of the received message (not used during transmission). |
|
|
The payload. The first ones are significant |
Exchange modes
-
CAN FD without switching speed:
ProtocolMode = 1,BRS = 0. The entire frame is transmitted at a nominal rate. -
CAN FD with speed switching:
ProtocolMode = 1,BRS = 1. The arbitration phase is transmitted at a nominal rate, and the data phase is transmitted at a rate set by the parameter Скорость фазы данных:. -
Combined CAN and CAN FD: the format of each transmitted frame is selected via
ProtocolMode. Block RITM-CANFD RX accepts both formats and fills inProtocolModebased on the frame that was actually taken.
Regular blocks RITM-CAN TX and RITM-CAN RX it can be connected to the output of the unit RITM-CANFD Setup and use it for classic frames on an interface configured in CAN FD mode. These units work with the bus CAN_MESSAGE_BUS and are not intended to represent CAN FD frames; for mixed incoming traffic, use RITM-CANFD RX.