Wrong data type after canDatabase function

1 回表示 (過去 30 日間)
Serbring
Serbring 2021 年 11 月 11 日
回答済み: Pranjal Kaura 2021 年 11 月 23 日
Hi all,
I have a CANBUS data that I can open with Vector CANDdb editor. However, with Matlab I get something weird when I use the canDatabase function. In particular, I obtain the following:
candb1=database('xx.dbc');
class(candb1)
ans =
'database.odbc.connection'
Using other databases I obtain the variable 'can.Database'. Why does it occur?
Thank you.
Best regards,

回答 (1 件)

Pranjal Kaura
Pranjal Kaura 2021 年 11 月 23 日
Hey Serbring,
The 'database' function creates a connection object, which uses the ODBC or the JDBC driver depending on the connection. This is why you see a 'database.odbc.connection' being created. You can read more about 'connection' objects in the link attached. You can use the 'canDatabase' function to create handles to canDatabase files. You can also refer this link to know more about the current functionality MATLAB provides.
You can also go through 'Getting started with CAN communications in MATLAB' to know more.
Hope this helps!

カテゴリ

Help Center および File ExchangeVehicle Network Toolbox についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by