receive
Receive messages from CAN bus
Syntax
Description
returns a timetable of CAN messages received on the CAN channel
message
= receive(canch
,messagesrequested
,'OutputFormat','timetable')canch
. The number of messages returned is less than or equal
to messagesrequested
. If fewer messages are available than
messagesrequested
specifies, the function returns the
currently available messages. If no messages are available, the function returns an
empty array. If messagesrequested
is Inf
, the
function returns all available messages.
To understand the elements of a message, refer to canMessage
.
Specifying the 'OutputFormat'
option value of
'timetable'
results in a timetable of messages. This output
format is recommended for optimal performance and representation of CAN messages
within MATLAB®.
returns an array of CAN message objects instead of a timetable if the channel
message
= receive(canch
,messagesrequested
)ProtocolMode
is 'CAN'
.
Note
If the channel ProtocolMode
is 'CAN
FD'
the receive
function returns a
timetable, whether you specify an 'OutputFormat'
or
not.