This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

CAN FD Log

Log received CAN FD messages

Library

Vehicle Network Toolbox: CAN FD Communication

Description

The CAN FD Log block logs CAN FD messages from the CAN network or messages sent to the blocks input port to a .mat file. You can load the saved messages into MATLAB® for further analysis or into another Simulink® model.

Configure your CAN FD Log block to log from the Simulink input port. For more information, see Log and Replay CAN Messages.

The Log block appends the specified filename with the current date and time, creating unique log files for repeated logging.

If you want to use messages logged using Simulink blocks in the MATLAB Command window, use canFDMessage to convert messages to the correct format.

Note

You need a license for both Vehicle Network Toolbox™ and Simulink software to use this block.

Note

You cannot have more than one CAN FD Log block in a model using the same PEAK-System device channel.

Other Supported Features

The CAN FD Log block supports the use of Simulink Accelerator™ mode. Using this feature, you can speed up the execution of Simulink models. For more information on this feature, see Acceleration (Simulink).

Parameters

Tip

If you are logging from the network, you need to configure your CAN channel with a CAN FD Configuration block.

File name

Type the name and path of the file to log CAN FD messages to, or click Browse to browse to a file location.

The model appends the log file name with the current date and time in the YYYY-MMM-DD_hhmmss format. You can also open the block mask and specify a unique name to differentiate between your files for repeated logging.

Variable name

Type the variable saved in the MAT-file that holds the CAN FD message information.

Maximum number of messages to log

Specify the maximum number of messages this block can log from the selected device or port. The specified value must be a positive integer. If you do not specify a value the block uses the default value of 10,000 messages. The log file saves the most recent messages up to the specified maximum number.

Log messages from

Select the source of the messages logged by the block. Possible values are CAN FD Bus or Input port. To log messages from the network, you must specify a device.

Device

Select the device on the CAN network that you want to log messages from. This filed is unavailable if you select Input port for Log messages from option.

Sample time

Specify the sampling time of the block during simulation, which is the simulation time as described by the Simulink documentation. This value defines the frequency at which the CAN FD Log block runs during simulation. If the block is inside a triggered subsystem or to inherit sample time, you can specify –1 as your sample time. You can also specify a MATLAB variable for sample time. The default value is 0.01 (in seconds).

See Also

Blocks

Functions

Introduced in R2018b