Configure messages for periodic transmission


transmitPeriodic(canch, msg, 'On', period)
transmitPeriodic(canch, msg, 'Off')


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

transmitPeriodic(canch, msg, 'Off') disables periodic transmit of the message, msg, on the channel, canch.

Input Arguments


The name of the CAN channel on which the specified message is enabled for periodic transmit.


The message enabled for periodic transmission on the specified CAN channel.


Specify whether periodic transmission is enabled on the specified message. Input On for enabling periodic transmission on the specified message and Off to disable it. If you enable periodic transmission, specify a period value.


Specify a period in seconds. This value is used to transmit the message in the specified period. By default this value is 0.500 seconds.


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

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

Enable the message for periodic transmit. Set the period value to 1 sec, start the channel, and update the data in the message you want to send periodically:

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

More About

collapse all


You can enable and disable periodic transmit even when the channel is running. This functionality allows you to make changes to the state of the channel without stopping the channel.

Was this topic helpful?