Main Content

discard

Discard all messages from CAN channel

Description

discard(canch) discards messages that are available to receive on the channel canch.

example

Examples

collapse all

Set up a CAN channel to receive messages, then discard the messages.

Create a CAN channel to receive messages and start the channel.

rxCh = canChannel('Vector','CANcaseXL 1',1);
start (rxCh)

Discard all messages in this channel.

discard(rxCh);

Input Arguments

collapse all

CAN device channel, specified as a CAN channel object, that you want to discard the messages from.

Example: canChannel('NI','CAN1')

Version History

Introduced in R2012a

See Also

Functions