Embedded Target for Motorola MPC555    
CAN Message Packing

Map Simulink signals to CAN messages

Library

CAN Message Blocks

Description

The CAN Message Packing block builds a CAN message. The CAN message type can be either Extended or Standard. You can set the message identifier statically or dynamically. The input port is dynamically typed and will accept any standard Simulink data types as input, as long as the total size does not exceed 8 bytes (64 bits).

The input port can accept

The output data type is either CAN_MESSAGE_STANDARD or CAN_MESSAGE_EXTENDED.

In this block diagram, a CAN Message Packing block accepts a uint16 signal of width 2 (4 bytes). The lower input is a dynamic message ID (see CAN message identifier below).

Dialog Box

CAN message identifier
Set the identifier of the message. Note that an extended message has a 27 bit ID and a standard message has a 11 bit ID. If you specify that the value of the identifier is -1, then an extra input port on the block will appear. This lets you set the ID dynamically.
CAN message type
Specify the CAN message type: select either Standard (11 bit identifier) or Extended (29 bit identifier).
Signal byte ordering
Signals are packed into the message from left to right. Within each signal, however, the byte order for signals of more than one byte is defined by the signal byte ordering. To use the CAN Message Packing and CAN Message Unpacking blocks correctly, both blocks must use the same signal byte ordering.
The ordering can be either Little Endian or Big Endian.

  CAN Message Filter CAN Message Packing (CANdb)