Specifications

4 CAN I/O Support
4-52
CAN-AC2-104 (PC/104)
The CAN-AC2-104 is an ISA-board (PC/104), and the hardware interrupt line
is set by means of a software setting within the CAN Setup driver block. Write
down a free interrupt line, which is not used by any other hardware device in
the xPC target system (for example by the Ethernet card).
1 In the Simulink window, and from the Tools menu, point to Real-Time
Workshop
, and then click Options. Select the category “xPC Target code
generations options” in the displayed dialog box. In the “Real-Time
Interrupt Source” popup menu select the interrupt line number which you
have chosen.
2 In the model open the dialog box of the CAN Setup block for the
CAN-AC2-104 board. Select the chosen interrupt line in the “Interrupt Line”
popup menu and close the dialog box. Open the dialog box of the CAN
Receive block in the model which defines the CAN-message (identifier) to be
used to fire the interrupt. Check the “Generate interrupts” check box.
Checking this box will declare all CAN-messages defined in this Receive
block instance through their identifiers as messages, which will fire an
interrupt. Or in other words it is not possible to define a single
CAN-message within the set of defined identifiers to be the only one to fire
an interrupt. In most cases only the reception of one specific message is used
to drive the application execution. Therefore use at least two instances of the
Receive block. One to receive the CAN-message, which drives the execution
(Generate Interrupts checked) and the other for all other “normal”
CAN-messages to be received (Generate Interrupts unchecked).
After having completed the two steps the model is ready to be built. After the
downloading has succeeded and the target application execution has been
started, the execution is now driven by the selected CAN-message(s). The
execution time information displayed on the target screen is now directly
dependent on the reception of the corresponding message. If no message is
received the time will not advance. You should make sure, that the
corresponding CAN-message on the other CAN node is only generated if the
xPC target application is running, otherwise “unexpected interrupt” messages
may be displayed on the target screen.