configBusSpeed
Set bit timing rate of CAN channel
Syntax
Description
configBusSpeed(
sets the speed of the CAN channel in a direct form that uses baseline bit timing calculation factors.canch
,busspeed
)
Unless you have specific timing requirements for your CAN connection, use the direct form of
configBusSpeed
. Also note that you can set the bus speed only when the CAN channel is offline. The channel must also have initialization access to the CAN device.Synchronize all nodes on the network for CAN to work successfully. However, over time, clocks on different nodes will get out of sync, and must resynchronize.
SJW
specifies the maximum width (in time) that you can add toTSeg1
(in a slower transmitter), or subtract fromTSeg2
(in a faster transmitter) to regain synchronization during the receipt of a CAN message.
configBusSpeed(
sets the speed of the CAN channelcanch
,busspeed
,SJW
,TSeg1
,TSeg2
,numsamples
)canch
tobusspeed
using the specified bit timing calculation factors to control the timing in an advanced form.
Note
Before you can start a channel to transmit or receive CAN FD messages, you must configure its bus speed.
configBusSpeed(
sets the arbitration and data bus speeds ofcanch
,arbbusspeed
,databusspeed
)canch
using default bit timing calculation factors for CAN FD. This syntax supports NI and MathWorks virtual devices.
configBusSpeed(
sets the data and arbitration bus speeds ofcanch
,arbbusspeed
,arbSJW
,arbTSeg1
,arbTSeg2
,databusspeed
,dataSJW
,dataTSeg1
,dataTSeg2
)canch
using the specified bit timing calculation factors in an advanced form for CAN FD. This syntax supports Kvaser and Vector devices.