Skip to Main Content Skip to Search
Product Documentation

Constructing and Extracting CAN Data Frames

CAN data frames have a maximum size of 8 bytes (64 bits). The CAN driver blocks in the xPC Target I/O block library use Simulink signals of data type CAN_MESSAGE or double to propagate data frames as an entity. In most applications, the data frame content does not consist of 64-bit floating point values; instead they are constructed from one or more smaller data type entities such as signed and unsigned integers of various sizes.

To simplify the construction and extraction of data frames for the user, the xPC Target I/O library contains two utility blocks (found in subgroup CAN/Utilities) that allow bit-packing (construction) and bit-unpacking (extraction) of data frames in a very flexible way.

The main purpose of the two blocks is to be used in conjunction with CAN Send and Receive driver blocks for double data type. You can use them for other types of double type data manipulation. Their functionality is entirely independent of any CAN driver blocks or CAN library.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS