Specifications

4 CAN I/O Support
4-40
CAN Bit-Packing Block
This block is used to construct CAN data frames and it’s output port is
normally connected to an input port of a CAN Send driver block. The block has
one output port of data type double (a scalar) which represents the data frame
entity constructed by the signals entering the block at it’s input ports. The
number of input ports and the data type of each input port depends on the
setting in the blocks dialog box.
The dialog box contains one single control (edit field) which lets you define the
bit patterns in a flexible way. The data type entered in the control has to be a
MATLAB cell array vector. The number of elements in the cell array define the
number of input ports shown by this block instance. The cell array elements
have to be of type double array and define where each bit of the incoming value
(data typed input port) comes to lie at what position in the outgoing double
value (data frame).
From a data type perspective (input ports) the block behaves like a Simulink
sink block and therefore the data types of the input ports are inherited from
the driving blocks.
The sample time of the block is also inherited from the driving blocks.
Therefore no explicit sample time has to be provided in the block’s dialog box.
The functionality of the block is easiest explained by means of an example.