Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading value descriptions from DBC

Hello,

 

I have a dbc file which for some signals includes 'value descriptions'. These can be read, for example, in the Vector CAN DB editor.

Does anyone have any experience in reading these programmatically in LabVIEW?

It would be great to auto-populate a ring to provide the user with some feedback on the signals.

Thanks all

Nick
0 Kudos
Message 1 of 5
(3,305 Views)

Yup this is done through XNet.  Once you install the full XNet driver you get the XNet Database Editor (check your start menu).  From here you can import a DBC, or make a new database from scratch defining the frames and signals.  Some things it can show better than Vector's tools and somethings it is worst at.  Viewing the bits in a frame and being able to see what signals are where is a super handy thing that Vector's tool doesn't do.  But if you have a signal with enumerated values in it, I don't think you can see what they are in the XNet Database editor.  Along with the Database Editor there is an API provided from NI which allows for programatically importing a DBC and querying various parts of the database.  You can also create the database using the API.  Through this API all things about the DBC can be queried (like the enumerated values).

 

Here is the Signal Frame Conversion software I made which uses XNet to import the included DBC, and read the signal scaling information.  Look through the source and you should be able to understand how it works.  There are also several examples in LabVIEW in Help >> Find Examples after installing XNet of course.

0 Kudos
Message 2 of 5
(3,288 Views)

Look at Get DBC Attribute (Signal) VI in XNET database section. Set the Mode input to Signal Value Table.

Message 3 of 5
(3,282 Views)

Thanks WaldemarM and Hoovah.

 

Managed to get it working in the end.

 

Hoovah: I did find the 'Get String Signal Data From Signal List.vi' which uses the API call suggested by WaldemarM.

 

It took me a while to realise that I was loosing the enum data when merging databases using the XNET database editor tool. If I just created the alias straight from the .dbc file, everything was hunky dory.

 

This is a bit of a shame. Any ideas for a workaround for this? Prehaps a different 3rd party tool to merge databases? I can probably request a merged database from the ECU team but would be nice to solve the problem anyhow! 

Nick
0 Kudos
Message 4 of 5
(3,267 Views)

I'm not aware of a tool that merges DBC files.  You could likely make one using XNet tools for importing then editing but as you stated you need to make sure it gets all the information including enumerations.

0 Kudos
Message 5 of 5
(3,229 Views)