Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to read a dbc file can anyone tell me how to load it in visual studio.

int main(int argc, char *argv[])
{
string filename = ( "MQB2020_ICAN_KMatrix_V9.02.01F_20170316_MB.dbc");
Network network;

if (argc != 2) {
std::cout << "List_Messages_Signals <database.dbc>" << std::endl;
return -1;
}

/* load database file */
File file ;
if (file.load(network, filename) != Status::Ok) {
return EXIT_FAILURE;
}

any changes to be made in code or any ways to input the file

What I have tried:

tutorial of file loading and also the stream commands
Posted
Updated 6-Dec-17 0:49am
Comments
Richard MacCutchan 6-Dec-17 4:07am    
What is the format of the contents of this file?
Member 13475664 6-Dec-17 4:33am    
CAN messages and signals

1 solution

You have to write a parser for the file format or use a library providing such. How to handle the parsed data depends then on your requirements.

As a starting point you might have a look at cantools download | SourceForge.net[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900