Main Content

CAN Configuration

Configure parameters for specified CAN device

  • CAN Configuration block

Libraries:
Vehicle Network Toolbox / CAN Communication

Description

The CAN Configuration block configures parameters for a CAN device that you can use to transmit and receive messages.

Specify the configuration of your CAN device before you configure other CAN blocks.

Use one CAN Configuration block to configure each device that sends and receives messages in your model. If you use a CAN Receive or a CAN Transmit block to receive and send messages on a device, your model requires a corresponding CAN Configuration block for the specified device.

Note

You need a license for both Vehicle Network Toolbox™ and Simulink® software to use this block.

Other Supported Features

The CAN Configuration block supports the use of Simulink accelerator and rapid accelerator modes. Using this feature, you can speed up the execution of Simulink models. For more information on this feature, see Acceleration (Simulink).

Examples

Parameters

expand all

Select the CAN device and a channel on the device that you want to use from the list. Use this device to transmit and receive messages. The device driver determines the default bus speed.

Programmatic Use

Block Parameter: Device
Type: character vector, string

Set the BusSpeed property for the selected device, in bits per second. The default bus speed is the default assigned by the selected device.

Programmatic Use

Block Parameter: BusSpeed
Type: character vector, string
Values: integer

Note

This option is available only for supporting vendors.

Select this check box to allow manual specifying of bit parameters. The bit parameter settings include: Synchronization jump width, Time segment 1, Time segment 2, and Number of samples. For more information on these parameters, see Bit Timing. If you do not select this option, the device automatically assigns the bit parameters depending on the bus speed setting.

Tip

Use the default bit parameter settings unless you have specific timing requirements for your CAN connection.

Programmatic Use

Block Parameter: EnableBitParameters
Type: character vector, string
Values: 'off' | 'on'
Default: 'off'

Specify the maximum limit of bit time adjustment in the case of resynchronization. The specified value must be a positive integer indicating a number of bit time quanta segments. If you do not specify a value, the selected bus speed setting determine the default value. To change this value, select the Enable bit parameters manually check box first.

Programmatic Use

Block Parameter: SJW
Type: character vector, string
Values: integer

Specify the number of bit time quanta before the sampling point. The specified value must be a positive integer. Typically, an adjustment of this value is made with a corresponding inverse adjustment to Time segment 2 so that their sum remains constant. If you do not specify a value, the selected bus speed setting determines the default value. To change this value, select the Enable bit parameters manually check box first.

Programmatic Use

Block Parameter: TSEG1
Type: character vector, string
Values: integer

Specify the number of bit time quanta after the sampling point. The specified value must be a positive integer. Typically, an adjustment of this value is made with a corresponding inverse adjustment to Time segment 1 so that their sum remains constant. If you do not specify a value, the selected bus speed setting determines the default value. To change this value, select the Enable bit parameters manually check box first.

Programmatic Use

Block Parameter: TSEG2
Type: character vector, string
Values: integer

Specify the number of samples per bit. The specified value must be a positive integer. If you do not specify a value, the selected bus speed setting determines the default value. To change this value, select the Enable bit parameters manually check box first.

Programmatic Use

Block Parameter: NSamples
Type: character vector, string
Values: integer

If you have set the bit parameter settings manually, click this button to see if your settings are valid. The block runs a check to see if the combination of your bus speed and bit parameter values form a valid combination for the CAN device. If the current combination is not valid, the verification fails and displays an error message. This button is active only when the Enable bit parameters manually check box is selected.

Programmatic Use

None

Specify whether the channel is in Normal or Silent mode. By default Acknowledge mode is Normal. In this mode, the channel can receive and transmit messages normally, and perform other tasks on the network such as acknowledging messages and creating error frames. To observe all message activity on the network and perform analysis, without affecting the network state or behavior, select Silent. In Silent mode, the channel can only receive messages and not transmit.

Programmatic Use

Block Parameter: AckMode
Type: character vector, string
Values: 'Normal' | 'Silent'
Default: 'Normal'

Extended Capabilities

Version History

Introduced in R2009a