Main Content

canMessageReplayBlockStruct

Convert CAN messages for use as CAN Replay block output

Description

example

msgstructofarrays = canMessageReplayBlockStruct(msgs) formats specified CAN messages for use with the CAN Replay block. The CAN Replay block requires a specific format for CAN 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 this variable to a MAT-file. The CAN Replay block mask allows selection of this MAT file and the variable within it, to define the messages to replay in a Simulink® model.

Examples

collapse all

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

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

Input Arguments

collapse all

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

Output Arguments

collapse all

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

Version History

Introduced in R2017a

See Also

Functions

Blocks