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.

OpNI-CAN Controller

Block

Mask

Description

These blocks are used to define the setting of a CAN bus physical port. Each controller block is assigned a unique ID that will be used by the OpNI-CAN Send and OpNI-CAN Receive blocks.

Parameters

General Parameters

DeviceSelect the NI-CAN device to use.
Controller IDUniqueID that will be used by the NI-CAN Send and Receive icon. The value must be ranging from 1 to 255.
Device Indexindex of the CAN card on the PCI or PXI bus. See definition.
ChannelPhysical channel to be used.
XS Transceiver TypeAvailable for the devices on which it is possible to operate the board in different modes. See the NI-CAN Hardware and Software Manual for more info.
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 the NI-CAN Hardware and Software Manual or the for more info.
Std / Xtd Acceptance Code / Mask

These values define thereception filter for standard (Std,11 bits) or Extended (Xtd, 29bits)messages on the selected channel. The reception filter follows thefollowing 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.


Inputs

None

Outputs

Error

The error output is normally zero and changes to a negative number if an error condition exists. It can be related to different parameters from the mask parameters or from the CAN device. The RT-LAB display usually gives a detailed explanation about the error to help correct the problem when the Target information display is set higher than"minimal".

Error values
0No Error
negativeError

Characteristics and Limitations

Board

The PXI-CAN board is very sensitive to IRQ problems. In the PXI chassis, the model can crash silently if the board is sharing its IRQ line with other devices. If crashes are experienced, changing the PXI slot may correct the problem, if not, use the BIOS utility to assign an IRQ line exclusively for the CAN board.

Driver

The firmware files from NI are installed by default in the /common/lib directory in the OPAL-RT root directory. If they were removed for any reason, they should be placed manually back into that directory. The OPAL-RT root directory is read from the OPALRT_ROOT_KEY_QNXNTOenvironnment variable. Inside that directory, the path to the firmware file is /common/lib/ni8464/. The firmware files must be named nican_s1.nfwor nican_s2.nfw

Communication

BEWARE: CAN communication requires 120 Ohms resistors to be placed at each end of the network to function properly according to the following figure:

Direct FeedthroughNo
Discrete sample timeNo
XHP supportNo
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
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter