xPC Target | ![]() ![]() |
CAN-AC2-ISA with Intel 82527
The second level of the library contains three driver blocks, one for setting up the board, one for sending CAN-messages and one for receiving CAN-messages.
Setup-block
Every SIMULINK-model which sends and receives CAN-messages over the CAN-AC2 board has to contain exactly one setup-block. The setup-block does not have any inputs or outputs.
The dialogue-box allows to define general settings for the CAN-AC2 board. The corresponding code (initializing the board) is executed once during the "initializing blocks"-phase after the xPC Target application has been downloaded.
The first dialogue-field (popup) allows to specify the memory-address range used to access the board. The CAN-AC2 can be mapped into memory between D0000-EFFFF. See the CAN-AC2 user's guide for further information. If used with xPC Target memory mapped I/O-devices can only be mapped into a subarea of the choosable memory range of the CAN-AC2.
We recommend to use the following configurations if using xPC Target Version 1.1
2: D4000-D7FFF 3: D8000-D8FFF
The second and third dialogue-field allows to choose the baudrate of CAN-port 1. If the baudrate within the popup menu is not set to "user defined" the entries in the "user-defined" dialogue-field have no meaning. If it is set to "user defined" a wide range of baudrates can be set by setting Prescaler, Width, Tseg1, Tseg2 to appropriate values. Contact the CAN-AC2 manual for detailed information how to set "user defined" baudrates.
With the fourth and fifth dialogue-field the baudrate for CAN-port 2 can be set.
The last 4 dialogue-entries are used to define the Identifiers of all CAN-messages sent or received within the current SIMULINK-model. There is one dialogue-field for send- and receive-identifiers for CAN-port 1 and 2. Each entry can contain a row vector with a maximal number of 200 identifiers. Each identifier can be in the range of -2032..(2^29-1). Because CAN-specification 2.0B allows to send and receive messages with standard (11bit) and extended identifiers (29bit) concurrently the following identifier numbering method has been implemented:
Send-block
To send CAN-messages specified in the setup-block, a SIMULINK-model can contain as many as needed send-blocks.
The first dialogue-entry specifies via which CAN-port the CAN-message should be sent.
The second dialogue-entry specifies the identifiers for CAN-messages to be sent. The identifiers entered here as a row-vector have to be a subset of the send identifiers defined in the setup-block of either CAN-port 1 or 2. If an identifier is specified which was not defined in the seup-block an error message is output after downloading the xPC Target application. The block has as many inputs as the row-vector has elements.
The data (double / 8byte) of the first input is sent as the CAN-message with the identifier of the first element of the vector, the second input is sent with the identifier of the second element of the vector and so on.
The third dialogue-field specifies at which sample time intervals the CAN-messages are sent. By using more than one send-block it is possible to send CAN-messages at different sample time intervals even with the same identifiers by entering appropriate sample times for each send-block.
Receive-block
To receive CAN-messages specified in the setup-block, a SIMULINK-model can contain as many as needed receive-blocks.
The first dialogue-entry specifies from which CAN-port the CAN-message should be received.
The second dialogue-entry specifies the identifiers for CAN-messages to be received. The identifiers entered here as a row-vector have to be a subset of the receive identifiers defined in the setup-block of either CAN-port 1 or 2. If the an identifier is specified which was not defined in the seup-block an according error message is output after downloading the xPC Target application. The block has as many outputs as the row-vector has elements. The data (double / 8byte) received with the identifier as the first element of the is output on the first block output and so on
The third dialogue-field specifies at which sample time intervals the CAN-messages have to be read out of the object buffer. By using more than one receive-block it is possible to get CAN-messages at different sample time intervals even with the same identifiers by entering appropriate sample times for each receive-block.
![]() | CAN-AC2-ISA with Philips PCA82C200 | CAN-AC2-PCI | ![]() |