canDatabase
创建 CAN 数据库文件的句柄
说明
创建指定数据库文件 candb
= canDatabase('dbfile.dbc
')dbfile.dbc
的句柄。您可以指定文件名、完整路径或相对路径。MATLAB® 会在 MATLAB 路径中查找 dbfile.dbc
。Vehicle Network Toolbox™ 支持 Vector CAN 数据库 (.dbc
) 文件。
示例
创建 CAN 数据库对象
为示例数据库文件创建对象。
candb = canDatabase("C:\myVNTData\demoVNT_CANdbFiles.dbc");
candb = Database with properties: Name: 'demoVNT_CANdbFiles' Path: 'C:\myVNTData\demoVNT_CANdbFiles.dbc' Nodes: {} NodeInfo: [0×0 struct] Messages: {5×1 cell} MessageInfo: [5×1 struct] Attributes: {} AttributeInfo: [0×0 struct] UserData: []
candb = canDatabase("C:\myVNTData\J1939.dbc")
candb = Database with properties: Name: 'J1939' Path: 'C:\myVNTData\J1939.dbc' Nodes: {2×1 cell} NodeInfo: [2×1 struct] Messages: {2×1 cell} MessageInfo: [2×1 struct] Attributes: {3×1 cell} AttributeInfo: [3×1 struct] UserData: []
输入参数
dbfile.dbc
— 数据库文件名
字符向量 | 字符串
数据库文件名,指定为字符向量或字符串。您可以仅指定数据库文件的名称或完整路径。
示例: 'J1939.dbc'
数据类型: char
| string
输出参数
candb
— CAN 数据库
数据库对象
CAN 数据库,以具有 can.Database 属性 的数据库对象形式返回。
版本历史记录
在 R2009a 中推出
MATLAB 命令
您点击的链接对应于以下 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:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)