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

CAN Database Parser Write

CAN Database Parser Write — Sends CAN (HS) and CAN FD messages to one channel

Library

Simulink Real-Time - Speedgoat

Description

The CAN DB Parser Write block consists of a masked subsystem, which adds an additional functionality layer to the existing CAN Write block. The subsystem is dynamically populated with a set of preconfigured CAN Pack or CAN FD Pack blocks, the corresponding CAN Write blocks, preconfigured input ports and the interconnecting lines. The CAN DB Parser Write block mask allows users to select which messages of a *.dbc file should be transmitted.

As an alternative to configuring the CAN DB Parser Write block using the application, the DB Parser Block Config class can be used to perform the mapping process programmatically.

The CAN DB Parser Write block executes according to the settings in the corresponding CAN Setup block. The execution primarily depends on whether the operation mode is set to CAN (HS) or CAN FD. It is the user's responsibility to ensure that the operation mode selected in the CAN Setup block matches the operation mode defined in the *.dbc file in use.

The CAN DB Parser Write block cannot be edited when linked to a custom library, as it contains instance-specific data that cannot be shared across links. The block remains editable within the library itself: changes made there will be reflected in all linked instances. Additionally, the block cannot be used within subsystem models, as these are not supported.

Each Write block has a software FIFO buffer in which Tx messages are queued. When selecting the sample time of the Write block, the user must ensure that all messages can be transmitted within a single sample step and that the bus is not overloaded.

Ports

The number and type of input ports depends on the setting of the Input Type parameter, except for the Enable input.

Inputs
Enable Input

This input port is available whenever the Show Enable Input checkbox in the block mask is activated. Use this port to enable (1) or disable (0) transmission of CAN messages during runtime. Each message may be controlled using an n-elements boolean vector, where n represents the number of messages from the *.dbc file that are enabled in the CAN DB Parser. The indexing of the messages aligns with the sorted ID numbers of all enabled messages, in ascending order.

Parameters

Configure CAN I/O Module
CAN I/O Module

Selects the CAN I/O module with which this driver block communicates. The list is populated according to the CAN setup blocks in the model. You can also set the value of this parameter to None (Outport) from the list. When None (Outport) is selected, the CAN messages are not sent by a CAN I/O interface, but are available on an output port as an array of CAN (FD) messages.

Channel Number

Selects the CAN channel with which this driver block communicates.

Configure CAN Bus
Bus Type

Shows whether the operation mode used for this block is set to CAN (HS) or CAN FD. This parameter is configured automatically according to the corresponding setting in the Setup block and cannot be changed by the user.

Input Type

Configure the input type of the block. Two options are available

  • Signals

    A port is created for each signal to transmit.

  • Bus (Mapping)

    When selecting this option, the input port will expect a single Simulink bus, and the Mapping tab will be enabled. Please refer to the usage notes for more information about the mapping functionalities.

Use Cycle Times from Database

Select this option to transmit CAN messages with the cycle time defined in the selected *.dbc file. If disabled, CAN messages are transmitted at the selected block sample time by default.

Show Enable Input

Select this option for the Enable Input Port to be available. With this port, messages can be enabled or disabled during execution.

Configure Sample Time
Sample Time

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

Configure CAN Parsing

Database
CANdb file

Select the database file from which to choose the desired signals to transmit. The Messages table is dynamically populated based on the selected entry of this list. This list is populated through the CAN Database Manager. For further information about the CAN Database Manager, please refer to the usage notes

Messages
Enable all

Allows users to enable or disable all available messages in one click.

Add/Remove Selected

After selecting multiple messages in the table (Ctrl + left-click), all these messages can be simultaneously enabled or disabled.

IDs in hex

In the Messages table, IDs are displayed in decimal form by default. By enabling this command, the IDs can be displayed in hexadecimal format. This option is also available in the Mapping tab.

Signals

The Signals table shows the signals related to the last enabled/disabled message. No actions are available for this table.