Main Content

Communication in MATLAB

Configure CAN hardware; send and receive messages on a network

Hardware connection functions define a connection to a CAN interface hardware that establishes a physical connection to a CAN bus. The CAN Transmit Workflow shows how to pack and transmit CAN messages with MATLAB®. You can also employ event-based message transmission; load and replay messages. The CAN Receive Workflow shows how to receive and unpack CAN messages.

For building Simulink® models that use CAN blocks to transmit and receive messages on the network, see Communication in Simulink.


expand all

canChannelListInformation on available CAN devices
canChannelConstruct CAN channel connected to specified device
discardDiscard all messages from CAN channel
configBusSpeedSet bit timing rate of CAN channel
canSupportGenerate technical support log
canMessageBuild CAN message based on user-specified structure
packPack signal data into CAN message
startSet CAN channel online
transmitSend CAN messages to CAN bus
replayRetransmit messages from CAN bus
transmitConfigurationDisplay messages configured for automatic transmission
transmitEventConfigure messages for event-based transmission
transmitPeriodicConfigure messages for periodic transmission
receiveReceive messages from CAN bus
attachDatabaseAttach CAN database to messages and remove CAN database from messages
stopSet CAN channel offline
unpackUnpack signal data from CAN message
extractAllSelect all instances of CAN message from message array
extractRecentSelect most recent CAN message from array of messages
extractTimeSelect CAN messages occurring within specified time range
canMessageImport Import CAN messages from third-party log file
canSignalImportImport CAN log file into decoded signal timetables
canMessageTimetableConvert CAN messages into timetable
canSignalTimetableCreate CAN signal timetable from CAN message timetable
canFDChannelListInformation on available CAN FD device channels
canFDChannelConstruct CAN FD channel connected to specified device
canFDMessageBuild CAN FD message based on user-specified structure
canFDMessageTimetableConvert CAN or CAN FD messages into timetable
canFDMessageReplayBlockStructConvert CAN FD messages for use as CAN Replay block output
canDatabaseCreate handle to CAN database file
attributeInfoInformation about CAN database attributes
nodeInfoInformation about CAN database node
messageInfoInformation about CAN database messages
signalInfoInformation about signals in CAN message
valueTableTextLook up value of table text for signal
canMessageImport Import CAN messages from third-party log file
canSignalImportImport CAN log file into decoded signal timetables
filterAllowAllAllow all CAN messages of specified identifier type
filterAllowOnlyConfigure CAN message filter to allow only specified messages
filterBlockAllConfigure filter to block CAN messages with specified identifier type


expand all

can.Channel PropertiesProperties of the can.Channel object
can.Message PropertiesProperties of the can.Message object
can.Database PropertiesProperties of the can.Database object


CAN Messages

Message Database