This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Configure messages for event-based transmission


transmitEvent(canch, msg, state)


transmitEvent(canch, msg, state) enables an event-based transmit of the CAN message, msg, on the channel, canch when 'state' is On and disables it when 'state' is Off.

Input Arguments


The name of the CAN channel on which the specified message is enabled for event-based transmit.


The message enabled for event-based transmission on the specified CAN channel.


Specify whether event-based transmission is enabled on the specified message. Input On to enable event-based transmission on the specified message, and Off for disabling it.


Construct a CAN channel and configure a message on the channel:

canch = canChannel('Vector', 'CANCaseXL 1', 1);
msg = canMessage(500, false, 4);

Enable the message for event-based transmit, start the channel, and change some data to trigger the event-based transmit:

transmitEvent(ch, msg, 'On');
msg.Data = [1 2 3 4];

Introduced in R2010b

Was this topic helpful?