Specifications
4 CAN I/O Support
4-48
Detecting Timeouts When Receiving CAN Messages
The Receive driver blocks for all CAN boards allow to output the timestamp at
which the latest corresponding CAN message has been received. This
information can be used to detect if another CAN node is still alive and
therefore is sending CAN messages or is no longer alive and special action has
to be taken. Assume that we expect a CAN message from another CAN node
every 2 ms. If no new message is received within 10 ms the other CAN node is
being considered faulty and the Simulink model (target application) has to
proceed accordingly.
The CAN blockset in the xPC Target I/O block library provides a utility block
called CAN Timeout Detection. This is a simple graphical subsystem (inspect
it by looking under it’s mask) which uses the timestamp information to
calculate the timeout condition.
A Simulink model using this block in conjunction with a Receive block could
look as follows.