| Contents | Index |
message = receive(canch, messagesrequested)
message = receive(canch, messagesrequested) returns an array of CAN message objects received on the CAN channel 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 infinite, the function returns all available messages.
To understand the elements of a message, refer to canMessage.
canch |
The CAN channel from which to receive the message. |
messagesrequested |
The maximum count of messages to receive. The specified value must be a nonzero and positive, or Inf. |
message |
An array of CAN message objects received from the channel. |
| MessageReceivedFcn | Specify function to run |
| MessageReceivedFcnCount | Specify number of messages available before function is triggered |
| MessagesAvailable | Display number of messages available to be received by CAN channel |
| MessagesReceived | Display number of messages received by CAN channel |
| MessagesTransmitted | Display number of messages transmitted by CAN channel |
| ReceiveErrorCount | Display number of received errors detected by channel |
| TransmitErrorCount | Display number of transmitted errors by channel |
canch = canChannel('Vector','CANCaseXL 1',1)
start(canch)
message = receive(canch,5)To receive all messages, type:
message = receive(canch,Inf)
canChannel | canMessage | transmit

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |