Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

OpCanAc2 Controller

Block

Mask

CAN-AC2 PCI

CAN-AC2 104 (PC/104)

Description

The OpCanAc2 Controller block is used to define the settings of a CANbus physical port. Each controller block is assigned a uniqueID that is used by the OpCanAc2 Send, OpCanAc2 Receive and OpCanAc2 Monitor blocks.



Note: Previous versions of this block supported a mode called DynamicObject Buffering. This has been removed. Models previously built with this option should still work but only FIFO mode may become functional in future releases.


Parameters

The availability of some parameters relies on the card type (PCI, PC/104). See the specific parameters below.

General Parameters

Controller IDUniqueID that will be used by the Can-Ac2 Send and Receive blocks. The value must be ranging from 0 to 15.
ModelType of the card. Select between PC 104 and PCI. Normally this parameter does not need to be changed, the user should rather select and drag-and-drop the PCI or the PC104 block from the library.
Channel:Physical channel/port to be used.
Baud RateCommunication Baud Rate on the selected channel. It is to possible to select either predefined values or CUSTOM. When selecting CUSTOM, the following presc, sjw, tseg1, tseg2 and sam are used for defining a specific baud rate. See Can-Ac2 User Manual for more information.
Std/Xtd Acceptance Code/ MaskThese values define the reception filter for standard (Std,11 bits) or Extended (Xtd, 29bits)messages on the selected channel.


The reception filter follows the following condition:

Accept message if ((MsgID ^ Acc.Code) & Mask) == 0 
where ^ is a bitwise exclusive OR and & is a bitwise AND.

Examples:

  • For accepting all messages, use Std and Xtd Acceptance Code=0, Std and Xtd Acceptance Mask=0 (Default value)
  • For accepting only Standard and Extended message with an identifierequal to 1, use Std Acceptance Code = 0x7ff , Std Acceptance Mask= 0x001, Xtd Acceptance Code = 0x1fffffff , Xtd Acceptance Mask= 0x00000001.
Plug-In ModuleEnable an optional plug-in module for the Can-Ac2 card (ie. Single Wire). This mode is available with the PCICan-Ac2 card only. Refer to the Characteristics and limitation section below for baud rate and connection requirements.
Show error frame countCreates an additional outport which produces the number of error frames detected since the beginning of the execution.
Show bus loadCreates an additional Error Frame Count outport which indicates the number of packets per second which went through the bus (includes incoming and outgoing messages). This value is refreshed continuously at the rate specified in the Bus Load Refresh Rate parameter.
Bus load refresh rateSpecifies the refresh rate in seconds of the Bus Load outport.
Show bus stateCreates an additional Bus State outport which indicates the current bus state (error passive, error active or bus off).
Show application statusCreates an additional Status outport which indicates the current status of the CAN application.
Use send enable inportThis option activates the Enable inport which allows the user to disable all the send blocks related to this controller. This is mainly useful if a model uses both channels but the setup has only one of them actually connected to active devices. In such a situation, the CanAc2 will go into an error mode and transmission on both channels will stop. Deactivating transmission on the unused channel is the solution in such circumstances. Communication will resume as soon as the cards FIFO gets full and is cleared by the software.
Use the chip reset inportCreates an additional Reset inport which allows triggering a reset operation of the Can-Ac2 board. This is useful to recover from the BUS OFF state.
Purge the transmission FIFO on error frame detectionAssures that a purge of the transmission FIFO will occur when an error frame is detected.
Perform automatic chip reset after several consecutive error frames

A chip reset is automatically performed after several error frames.



Warning: This feature may disappear from future versions of RT-LAB.


Number of consecutive error frames to tolerate

The number of error frames tolerated before performing a chip reset.



Warning: This feature may disappear from future versions of RT-LAB.


Output modeEnables/Disables the CanAc2-PCI card to send data frames or any acknowledge bit on received messages. By doing this the CAN interface can monitor the bus without influencing it.


ValueDescription
silentCanAc2-PCI card is disabled to send data frames or any acknowledge bit. Monitoring mode.
activeCanAc2-PCI card is enabled to send data frames or any acknowledge bit

Can-Ac2 PCI Specific Parameters

PCI IndexPCIindex of the Can-Ac2 card. See definition.

Can-Ac2-104 (PC/104) Specific Parameters

DPRAM Base AddressBase address where the Can-Ac2-104 DPRAM should be located. The default setting is 0xd0000. See the Can-Ac2 User Manual for more details.
IO Base addressBase address of the Can-Ac2-104 configuration registers as selected by the onboard DIP switches. See the I/O address section below for the switch settings. This board reserves an I/O space of 4 byte values after the board address. For example, if the board address is set to 0x300, the addresses 0x300 to 0x303 are reserved. To avoid contention and overlaps of I/O spaces when several PC104 boards are installed in your system, pay special attention to the base addresses of the various boards.

Inputs

EnableOptional inport through which the send blocks can be enabled/disabled.A value of 1 activates the blocks, a value of 0 disables them.
ResetOptional inport which may be used to trigger a reset of the CanAc2. This is useful to recover from a BUS OFF state. Any input value higher than 0.5 triggers the reset. Note that no CAN operation is performed during a reset and that the reset operation may last several calculation steps. The Status output may be used to probe the duration of the reset operation. Also, the reset operation affects both channels of the CanAc2.

Outputs

BusError A and B: Optional outport that indicates the number of error frames detected since the beginning of execution.

Bus load: Optional outport that indicates the number of packets/second that went through the channel.

Bus state: Optional outport that indicates the current bus state. Possible values are listed in the following table.

ValueDescription
0Error active
1Error passive
2Bus off

Status: Optional output that produces global status info about the CAN application. Possible values are listed in the following table.

ValueDescription
0No errors or warning.
1Processing a reset operation. No CAN operation may be performed.
2Purging the transmission FIFO content because of the detection of an error frame (ER).
3Transmission disabled either through the Enable inport or because of a FIFO purge.
4Purging the transmission FIFA content when it is FULL caused by a dysfunctional transmission.

Characteristics and Limitations

The maximum number of CanAc2 devices that are simultaneously supported in a given subsystem is 8.



BEWARE: For functional CAN communication, 120 Ohms resistors must be placed at each end of the network as shown in the following figure. Note that the CanAc2-PCI already contains these resistors for both channels. The DIP switch of the selected channels, located on the PCI bracket, must be turned on to insert the onboard resistors into the circuit.



CanAc2 104 I/O Address Selection

The 4 byte I/O address range is chosen with the 8 DIP switches S2. The start address is determined by adding the values in the following table of every turned off switch.

Switch12345678
Value0x2000x1000x800x400x200x100x80x4

For instance, if switches 1, 2, 3, 6, 7 and 8 are OFF, the resulting I/O is 0x200+0x100+0x80+0x10+0x8+0x4=0x39C

CanAc2 Single Wire Mode

This mode is available with the PCI card only. To activate this mode, the parameter Plug-In Module must be set to SINGLE WIRE. Thebaud rate must be set to less than 33 kBits/s.

On the PCI card, one plug-in module OPT-CAN-5790 must be installed on the piggy-back socket of each channel to be used in Single Wire mode. The jumpers located on the piggy-back connector must be removed before installing the module. The external dip switch located on the bracket of the CanAc2 card must be set to off to disable the termination resistor of the channel used in Single Wire mode.

CanAc2 Host Simulation

CanAc2 blocks now support execution of user-specific code duringWin32 target simulation. For more information, please refer to the CanAc2 Host Simulationdocumentation.

Direct FeedthroughNo
Discrete sample timeNo
XHP supportYes
Work offlineNo


OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323