xPC Target    

Constructing and Extracting CAN Data Frames

CAN data frames have a maximum size of 8 bytes (64 bits). For the CAN driver blocks found in the xPC Target I/O block library, Simulink signals of data type double are used to propagate data frames as an entity. But 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 like signed and unsigned integers of various size.

In order 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) which 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, but they can be used as well for other types of data manipulation. Their functionality is entirely independent of any CAN driver blocks or CAN library.


  Receive Driver Block CAN Bit-Packing Block