| Contents | Index |
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 CAN Bit-Packing and CAN Bit-Unpacking blocks work with data frames using double data types. They provide support for legacy models.
To construct and extract CAN_MESSAGE data types, use the CAN Pack and CAN Unpack blocks.
Tip
|

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.
![]() | CAN-AC2 and CANopen Devices | Detecting Timeouts When Receiving CAN Messages | ![]() |

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 |