This is machine translation

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

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


Configure messages for periodic transmission





transmitPeriodic(canch,msg,'On',period) enables periodic transmit of the message, msg, on the channel, canch, to transmit at the specified period, period.

You can enable and disable periodic transmit even when the channel is running, allowing you to make changes to the state of the channel without stopping it.

transmitPeriodic(canch,msg,'Off') disables periodic transmission of the message, msg.


collapse all

Configure a channel to transmit messages periodically.

Construct a CAN channel and message.

canch = canChannel('MathWorks','Virtual 1',1);
msg = canMessage(500,false,4);

Enable the message for periodic transmission on the channel, with a period of 1 second. Start the channel, and pack the message you want to send periodically.


Input Arguments

collapse all

CAN channel, specified as a CAN channel object. This is the CAN channel on which the specified message is enabled for event-based transmission.

Message to transmit, specified as a CAN message object or array of message objects. This is the message enabled for periodic transmission on the specified CAN channel.

Period of transmissions, specified in seconds as a numeric value. This argument is optional, with a default of 0.5 seconds.

Example: 1.0

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Introduced in R2010b

Was this topic helpful?