DCAN device objects

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DCAN device objects

The communication device being used is determined with the DCAN device object. To address the DCAN device, it first has to be set up as a CAN device with the B&R CAN device configurator. Configuring CAN devices is done via the "CAN Devices" menu item in the Control Panel. The device list in the configurator shows all CAN devices which have already been set up. The device number must also be specified in the PVI device name. The CAN1 device corresponds to the PVI device name DCAN1. CAN2 corresponds to DCAN2, etc. the B&R CAN device configurator is also used to set device resources (IRQs, port addresses, etc.).

The communication device with the necessary device parameters is defined in the connection description of the device object. Within the connection description, individual parameters are differentiated between using parameter identifiers. These parameter identifiers always begin with the "/" character.

Connection description syntax:

/IF=<DeviceName>  [/<Identifier1>=<ParameterValue>  [/<Identifier2>=<ParameterValue> ... ]]

Device names are not case sensitive, and at least one space character must be between each parameter specification.

The connection description must always be specified in quotation marks ("...") in the object description.

The following table shows all parameters which can be defined for DCAN communication in the device object's connection description.

Par.

Values

Settings

Description

/IF

dcan1 ...

dcanX

None

CAN device. The device being used has to be entered in the device list of the B&R CAN device configurator.

Example: "/IF=dcan1"

/CNO

0, 1

0

CAN controller number (channel).

2 CAN controllers are available on the LS172 card. The desired controller is selected with the /CNO parameter. No value other than 0 (zero) may be specified for the default CAN controller.

Example for LS172 card:

CAN bus 1: "/IF=dcan2 /CNO=0"

CAN bus 2: "/IF=dcan2 /CNO=1"

/BD

10000,

20000,

50000,

100000,

125000,

150000,

250000,

500000,

800000,

1000000

*)

Baud rate (data rate) on the CAN bus in bits per second. This parameter can also be specified in kBits per second.

Example: "/BD=250000" or "/BD=250"

/CMODE

11, 29

*)

CAN communication with 29-bit identifiers (extended frames) or 11-bit identifiers (standard frames).

If 29-bit CAN identifiers (extended frames) are used, then 11-bit identifiers cannot be sent or received.

Example: "/CMODE=29"

/CT

>= 1,

0 = off

*)

Cycle time (in ms) within which the specified number (maximum) of CAN messages are sent (/MC parameter).

Values < 20 ms don't make sense.

Example: "/CT=20"

/MC

>= 1

*)

Maximum number of CAN messages sent within the specified cycle time (/CT parameter).

Example: "/MC=15"

  *)

The /BD, /CMODE, /CT, and /MC parameters can also be set using the B&R CAN device configurator. If these parameters are not specified in the connection description (the recommended method), then the values set in the configurator are used instead. If one of these parameters is specified in the connection description, then the corresponding configurator setting is overwritten.

The /CT and /MC parameters are used to limit messages. These allow the number of sent CAN messages to be restricted per cycle. This can reduce the load from the PC to the CAN bus. This could be important if other stations on the bus can only process a certain number of received CAN messages with the set baud rate, or if their interrupt load in general should be reduced. However, the disadvantage of limiting frames is slower CAN communication.

Connection description example:

CD="/IF=dcan3 /CNO=1"