Main Content

configBusSpeed

设置CAN通道的位时序率

Description

例子

configbusspeed(canchbusspeed的)以直接形式设置CAN通道的速度,该速度使用基线位定时计算因子。

  • 除非您的CAN连接有特定的时序要求,否则使用直接形式configBusSpeed。另请注意,只有在CAN频道脱机时才能设置总线速度。通道还必须具有对CAN设备的初始化访问。

  • 同步网络上的所有节点以便成功工作。但是,随着时间的推移,不同节点上的时钟将失去同步,并且必须重新同步。SJW.指定可以添加到的最大宽度(及时)Tseg1.(在较慢的发射器中),或减去Tseg2.(在更快的发射器中)以在收到CAN消息期间重新获得同步。

例子

configbusspeed(canchbusspeedSJW.Tseg1.Tseg2.numsamples.的)sets the speed of the CAN channelcanchbusspeed使用指定的位定时计算因子以高级表单控制定时。

笔记

Before you can start a channel to transmit or receive CAN FD messages, you must configure its bus speed.

例子

configbusspeed(cancharbbusspeedDataBusspeed的)sets the arbitration and data bus speeds ofcanchusing default bit timing calculation factors for CAN FD. This syntax supports NI and MathWorks virtual devices.

例子

configbusspeed(cancharbbusspeedarbsjwarbTSeg1arbTSeg2DataBusspeedDataSJW.datatseg1.datatseg2.的)设置数据和仲裁总线速度canch使用指定的位定时计算因子以AD CAN FD。此语法支持KVASER和金宝appVECURE设备。

例子

configbusspeed(canchclockfreqarbBRParbsjwarbTSeg1arbTSeg2DataBrp.DataSJW.datatseg1.datatseg2.的)设置数据和仲裁总线速度canch使用指定的位定时计算因子以AD CAN FD。This syntax supports PEAK-System devices.

Examples

全部收缩

使用基线位定时计算配置总线速度。

Configure for CAN.

canch = canchannel('Vector''CANCaseXL 1',1);ConfigBusspeed(CANCH,250000)

在Mathworks虚拟通道上配置CAN FD。

canch = canchannel('mathworks''Virtual 1'那1,'ProtocolMode''可以fd');ConfigBusspeed(CANCH,1000000,2000000)

Configure CAN FD on National Instruments™ device.

canch = canchannel('你''CAN1''ProtocolMode''可以fd');ConfigBusspeed(CANCH,1000000,2000000)

配置总线速度,指定位定时参数。

配置kvaser设备上的CAN定时。

canch = canchannel('Kvaser''usbcan professional 1',1);ConfigBusspeed(CANCH,500000,1,4,3,1)

在KVASER设备上配置CAN FD。

canch = canchannel('Kvaser''usbcan pro 1'那1,'ProtocolMode''可以fd');configbusspeed(canch,1e6,2,6,3,2e6,2,6,3)

在向量设备上配置CAN FD。

canch = canchannel('Vector''VN1610 1'那1,'ProtocolMode''可以fd');configbusspeed(canch,1e6,2,6,3,2e6,2,6,3)

Configure CAN FD on a PEAK-System device.

canch = canchannel('峰系''pcan_usbbus1''ProtocolMode''可以fd');ConfigBusspeed(CANCH,20,5,1,2,1,2,1,3,1)

输入参数

全部收缩

可以频道那specified as a CAN channel object.

通道的比特率,指定为双倍。提供每秒位的网络的速度。

Example:250000.

数据类型:双倍的

同步跳跃宽度,指定为双倍。定义网络上的一部分的长度。

数据类型:双倍的

指定为双重的时间段1,它定义在网络上采样比特之前的部分。

数据类型:双倍的

时间段2那specified as a double, which defines the section after a bit is sampled on a network.

数据类型:双倍的

位状态的样本数量那specified as a double. Specify the number of samples used for determining the bit state of a network.

数据类型:双倍的

通道的仲裁比特率,指定为双倍。提供每秒位的网络的速度。

Example:250000.

数据类型:双倍的

仲裁同步跳跃宽度那specified as a double. Define the length of a bit on the network.

数据类型:双倍的

仲裁时间段1那specified as a double, which defines the section before a bit is sampled on the network.

数据类型:双倍的

仲裁时间段2那specified as a double, which defines the section after a bit is sampled on a network.

数据类型:双倍的

通道的数据比特率,指定为双倍。提供每秒位的网络的速度。

Example:250000.

数据类型:双倍的

数据同步跳跃宽度,指定为双倍。定义网络上的一部分的长度。

数据类型:双倍的

数据时间段1指定为双重,该双面定义在网络上采样比特之前的部分。

数据类型:双倍的

数据时间段2那specified as a double, which defines the section after a bit is sampled on a network.

数据类型:双倍的

MHz中通道的时钟频率,指定为双倍。

Example:250000.

数据类型:双倍的

时间量子的仲裁钟预分析那specified as a double.

Example:5.

数据类型:双倍的

Data clock prescalar for time quantum, specified as a double.

Example:2

数据类型:双倍的

版本历史记录

在R2009A介绍

也可以看看

职能

特性

外部网站