帮助中心帮助中心
配置 J1939 通道的位定时
configBusSpeed(chan,busspeed)
configBusSpeed(chan,busspeed,SJW,TSeg1,TSeg2,numsamples)
示例
configBusSpeed(chan,busspeed) 使用默认位定时计算因子,以直接形式将 J1939 通道 chan 的速度设置为 busspeed。
chan
busspeed
注意
仅在通道处于离线状态且具有对设备的初始化访问权限时,才能设置位定时。
configBusSpeed(chan,busspeed,SJW,TSeg1,TSeg2,numsamples) 使用指定的位定时计算因子设置通道的速度。
SJW
TSeg1
TSeg2
numsamples
除非您的网络具有特定的定时要求,否则应使用该函数的直接形式。
全部折叠
使用语法的直接形式配置 J1939 通道总线速度。
db = canDatabase('MyDatabase.dbc'); chan = j1939Channel(db,'Vector','CANCaseXL 1',1); configBusSpeed(chan,250000)
使用语法的高级形式配置具有特定计算因子的 J1939 通道总线速度。
db = canDatabase('MyDatabase.dbc'); chan = j1939Channel(db,'Vector','CANCaseXL 1',1); configBusSpeed(chan,500000,1,4,3,1)
J1939 通道,指定为通道对象。使用 j1939Channel 函数创建和定义通道。
j1939Channel
通道的比特率,指定为双精度值。以每秒位数为单位表示网络速度。
示例: 250000
250000
数据类型: double
double
同步跳转宽度,指定为双精度值。用于定义网络上的一个位的长度。
时间段 1,指定为双精度值,用于定义在网络上对位进行采样之前的时间段。
时间段 2,指定为双精度值,用于定义在网络上对位进行采样之后的时间段。
位状态的采样数,指定为双精度值。指定用于确定网络的位状态的采样数。
在 R2015b 中推出
start
stop
transmit
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office