xPC Target | ![]() ![]() |
The Setup block is used to define general settings of the plugged-in CAN board(s). The CAN driver blocks for this board support up to three boards for each target system what leads to the availability of up to six CAN ports. For each board in the target system exactly one Setup block has to be used in a model. The dialog box of the Setup block lets you define the following settings.
Board -- Defines which board is being accessed by this driver block instance. The board number (1...3) can be seen as a reference identifier in order to differentiate the boards if multiple boards are present in the target system. The physical board finally referenced by the board number depends on the PCI Slot edit field described further below. If just one board is present in the target system, board number 1 should be selected.
CAN - Physical Bus -- Defines the physical CAN bus type of the CAN port 1. In the board's standard hardware configuration, only High speed CAN is supported. By extending the board with Low speed CAN piggyback modules, it is possible to additionally select Low speed CAN as the physical bus. The value of this control shouldn't be changed to Low speed if no module is present for the corresponding CAN port. If the module is present (see the Softing user manual on how to install the modules), you can select between High speed and Low speed CAN.
CAN 1 - Baudrate -- Defines the most common baud rates for CAN port 1. If special timing is necessary (baud rate), select User defined.
CAN 1 - User defined Baudrate -- If you select User defined from the CAN-1 Baud rate list, enter the four values for the timing information. The vector elements have the following meaning.
For more information about these values see the Softing user manual for this board.
CAN 2 - Physical Bus -- Defines the physical CAN bus type of the CAN port 2. In the board's standard hardware configuration, only High speed CAN is supported. By extending the board with Low speed CAN piggyback modules, it is possible to additionally select Low speed CAN as the physical bus. The value of this control shouldn't be changed to Low speed if no module is present for the corresponding CAN port. If the module is present (see the Softing user manual on how to install the modules), you can select between High speed and Low speed CAN here.
CAN 2- Baudrate -- Defines the most common baud rates for CAN port 2. If special timing is necessary (baud rate), select User defined.
CAN 1 - User defined Baudrate -- If you select User defined from the CAN-2 Baud rate list, enter the four values for the timing information. The vector elements have the following meaning.
For more information about these values see the Softing user manual for this board.
CAN 2 - Acceptance -- Defines the acceptance filters for the CAN 1 port. Because the receive FIFO gets filled with any CAN messages going over the bus, the use of the CAN controller acceptance filters becomes important in order to filter out unwanted messages already at the controller level. This acceptance filter information is provided by a row vector with 4 elements, where the first two are used to define the acceptance mask and acceptance code for Standard identifiers and the latter two for Extended identifiers. The default value defined by the Setup block doesn't filter out any messages. For information on how to define the acceptance information in order to filter certain messages, see Acceptance Filters.
Enable error frame detection -- If the CAN controller should detect Error frames and forward these to the Receive FIFO, check this box. Checking this box makes sense for monitoring applications where you want to be informed about all events going over the bus. For low latency time applications, checking this box may increase the FIFO Read driver block latency time because the receive FIFO gets filled with additional events.
Initialization (struct) and Termination (struct) -- Define the CAN messages sent during initialization and termination of the Setup block. For more information, see the standard CAN driver documentation in Defining Initialization and Termination CAN Messages.
PCI Slot (-1: autosearch) -- Defines the PCI slot in which the referenced board (board number) resides. If only one CAN board is present in the target system, the value for this control should be -1
for auto search. This value makes sure that the xPC Target kernel automatically finds the board independently of the PCI slot it is plugged into. If two or more boards of this type are physically present in the target PC, enter the bus number and the PCI slot number of the board associated with this driver block. Use the format [BusNumber, SlotNumber]. Use the xPC Target function getxpcpci
to query the target system for installed PCI boards and the PCI slots they are plugged into. For more information see `help getxpcpci'.
The board allows activating proper termination for each of the two CAN ports separately by means of DIP-switches at the rear panel of the board. Refer to the Softing user manual on how the DIP-switches have to be set. Both CAN ports have to be terminated properly where you use the provided loop-back model in order to test the board and drivers.
![]() | CAN FIFO Driver Blocks for the CAN-AC2-PCI with Philips SJA1000 CAN-Controller | FIFO Write Driver Block | ![]() |