Documentation

Data

CAN message or J1939 parameter group data

Description

Use the Data property to define your message data in a CAN message or parameter group data in a J1939 parameter group.

Characteristics

Usage

CAN message, J1939 parameter group

Read only

Never

Data type

Numeric

Values

The data value is a uint8 array, based on the data length you specify in the message.

Examples

Specify CAN Message Data

Create a CAN message and load data into a message.

message = canMessage(2500, true, 4)
message.Data = [23 43 23 43 54 34 123 1]

If you are using a CAN database for your message definitions, change values of the specific signals in the message directly.

You can also use the pack function to load data into your message.

Specify J1939 Parameter Group Data

Create a parameter group and specify data.

pg = j1939ParameterGroup(db, 'PackedData')
pg.Data(1:2) = [50 0]

See Also

Functions

canMessage, pack

Was this topic helpful?