Main Content

canFDMessageReplayBlockStruct

Convert CAN FD messages for use as CAN Replay block output

Description

msgstructofarrays = canFDMessageReplayBlockStruct(msgs) formats the specified CAN FD messages for use with the CAN FD Replay block. The CAN FD Replay block requires a specific format for CAN FD messages, defined by a structure of arrays containing the ID, Extended, Data, and other message elements.

Use this function to assign the formatted message structure to a variable. Then save that variable to a MAT-file. The CAN FD Replay block mask allows selection of this MAT file and the variable within it, to replay the messages in a Simulink® model.

Examples

collapse all

Create a message structure for the CAN FD Replay block, and save it to a MAT-file.

canMsgs = canFDMessageReplayBlockStruct(messages);
save('ReplayBlockMessages.mat','canMsgs');

Input Arguments

collapse all

Original CAN FD messages, specified as a CAN FD message timetable or an array of CAN message objects.

Output Arguments

collapse all

Formatted CAN FD messages, returned as structure of arrays containing the ID, Extended, Data, and other elements of the messages.

Version History

Introduced in R2018b

See Also

Functions

Blocks