Main Content

configBusSpeed

Configure bit timing of J1939 channel

Description

configBusSpeed(chan,busspeed) sets the speed of the J1939 channel chan to busspeed in a direct form that uses default bit timing calculation factors.

Note

You can set bit timing only when the channel is offline and has initialization access to the device.

example

configBusSpeed(chan,busspeed,SJW,TSeg1,TSeg2,numsamples) sets the speed of the channel using specified bit timing calculation factors.

Note

Unless you have specific timing requirements provided for your network, you should use the direct form of the function.

example

Examples

collapse all

Use the direct form of syntax to configure a J1939 channel bus speed.

db = canDatabase('MyDatabase.dbc');
chan = j1939Channel(db,'Vector','CANCaseXL 1',1);
configBusSpeed(chan,250000)

Use the advanced form of syntax to configure a J1939 channel bus speed with specific calculation factors.

db = canDatabase('MyDatabase.dbc');
chan = j1939Channel(db,'Vector','CANCaseXL 1',1);
configBusSpeed(chan,500000,1,4,3,1)

Input Arguments

collapse all

J1939 channel, specified as a channel object. Use the j1939Channel function to create and define the channel.

Bit rate for channel, specified as a double. Provide the speed of the network in bits per second.

Example: 250000

Data Types: double

Synchronization Jump Width, specified as a double. Define the length of a bit on a network.

Data Types: double

Time segment 1, specified as a double, which defines the section before a bit is sampled on a network.

Data Types: double

Time segment 2, specified as a double, which defines the section after a bit is sampled on a network.

Data Types: double

Number of samples for bit state, specified as a double. Specify the number of samples used for determining the bit state of a network.

Data Types: double

Version History

Introduced in R2015b

See Also

Functions