Specifications
Introduction
4-3
the build process. This has to be done in the xPC Target setup environment
either using the xpcsetup-GUI or the corresponding command line functions.
See chapter 2 below for further information.
For each CAN-board three driver blocks are provided. These are: A Setup block,
which defines the type of physical connection (baud rate and so forth). Exactly
one instance of the setup block has to be defined in a model for each physically
installed CAN-board. A Send block, which transmits (sends) the data entering
the block’s input ports to the connected CAN-network. One or more instances
of the Send-block can be used in a model. A Receive block, which retrieves
(reads) CAN-messages received by the board and outputs the data at the
corresponding output ports. One or more instances of the Receive block can be
used in a model.
The maximum size of the data frame of a CAN-message is 8 bytes. This is the
same size as the C data type ‘double’ uses on PC-compatible systems. At the
same time, the double data type is the default data type used for Simulink
signals. Therefore the CAN data frame within a Simulink model can be easily
represented by a scalar Simulink signal even if the data frame normally has
nothing in common with a double floating point value. The xPC Target CAN
library provides a Utility sublibrary which offers bit-packing and
bit-unpacking blocks. These blocks are used to pack data types other than
doubles into 64 bits (8 bytes or a double) as well as for the opposite operation.
This will be discussed in greater details further below. What is important for
now, is, that CAN data frames are represented by Simulink signals of data type
double.
All drivers for the supported CAN-boards program the boards for the so-called
“dynamic object mode”. This is one of three modes the CAN-board firmware
from Softing can operate in. For a more detailed discussion of the three modes
see the board’s user manual. The dynamic object mode is best suited for
real-time environments where each component of the application has to have
deterministic time behavior. This is the case for xPC Target and that is the
main reason why this mode has been chosen over the other two modes, which
are FIFO and static object mode.
The following paragraph summarizes the differences between the three
supported Softing boards.