Documentation

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.

transmit

Send CAN messages to CAN bus

Syntax

transmit(canch, message)

Description

transmit(canch, message) sends the array of messages onto the bus via the CAN channel.

To understand the elements of a message, refer to canMessage.

Input Arguments

canch

The CAN channel that you specify to transmit the message.

message

The message or an array of messages that you specify to transmit via a CAN channel.

Examples

message = canMessage (250, false, 8)
message.Data = ([45 213 53 1 3 213 123 43])
canch = canChannel('Vector','CANCaseXL 1', 1)
start(canch)
transmit(canch, message)

To transmit an array, construct message1 and message2 as in this example, and type:

transmit(canch, [message, message1 message2])

To transmit messages on a remote frame, type:

message = canMessage(250, false 8, true)
message.Data = ([45 213 53 1 3 213 123 43])
message.Remote = true
canch = canChannel('Vector','CANCaseXL 1', 1)
start(canch)
transmit(canch, message)

More About

collapse all

Tips

The Transmit function ignores the Timestamp property and the Error property.

Introduced in R2009a

Was this topic helpful?